DEV Community

Play Button Pause Button
Vigneshwaran Vijayakumar for Winsides

Posted on

Video: Enable WSL 2 using CMD and PowerShell

Enable Via Command Prompt:

  • Open Command Prompt as Administrator.
  • Click Yes on the User Account Control.
  • In the CMD, type the following command and click enter.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enter fullscreen mode Exit fullscreen mode
  • WSL 2 requires Virtual Machine Platform; hence, we will enable Windows Virtual Machine Platform using the following command in the CMD.
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Enter fullscreen mode Exit fullscreen mode
  • Restart your System. That is it. WSL 2 is a go!

Enable via PowerShell

  • Open Windows PowerShell as Administrator.
  • Click Yes on the User Account Control.
  • In the PowerShell, type the following command and click enter.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -All -NoRestart
Enter fullscreen mode Exit fullscreen mode
  • Also, enable Virtual Machine Platform using the following command.
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All -NoRestart
Enter fullscreen mode Exit fullscreen mode

That is it. Restart your PC. WSL 2 is good to go!

Visit our detailed guide on winsides.com. You can also refer to our YouTube Tutorial

Top comments (0)