Installing Windows Subsystem for Linux (WSL) Inside VirtualBox VM 🌱

VirtualBox Settings

  1. Launch VirtualBox
  2. Right click on the Windows 10 VM > Settings...
  3. Select System from the left navigation > Click the Processor Tab
  4. Check the Enable Nested VT-x/AMD-V box
  5. Click OK to close the settings dialog
  6. Right click on the Windows 10 VM > Start > Normal Start

Installing WSL2 Inside the VM

  1. Launch Powershell as administrator
  2. Run the following command
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  3. Reboot
  4. If running Windows 2004 or newer, run the following additional commands to use WSL 2
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    wsl --set-default-version 2
  5. Click the Start Button > Search Microsoft Store > Select Microsoft Store
  6. Search for the Linux distribution to install (Debian, Ubuntu, etc)
  7. Select the Linux distribution and click the Get button in the upper right corner
  8. After the Linux distribution downloads and installs, select the distribution from the Start menu to launch it
  9. Input a username and password to be used in the Linux environment