Ensure that you have WSL installed (you can find instructions to do so here) and that you are running Windows 10 build 18917 or higher
To make sure you are using build 18917 or higher please join the Windows Insider Program and select the 'Fast' ring or the 'Slow' ring.
You can check your Windows version by opening Command Prompt and running the ver
command.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart windows
To set a distro please run:
wsl --set-version <Distro> 2
and make sure to replace <Distro>
with the actual name of your distro. (You can find these with the command: wsl -l
). You can change back to WSL1 at anytime by running the same command as above but replacing the '2' with a '1'.
Additionally, if you want to make WSL2 your default architecture you can do so with this command:
wsl --set-default-version 2
This will make any new distro that you install be initialized as a WSL2 distro.
To verify what versions of WSL each distro is using use the following command (only available in Windows Build 18917 or higher):
wsl --list --verbose
#or
wsl -l -v
The distro that you've chosen above should now display a '2' under the 'version' column. Now that you're finished feel free to start using your WSL2 distro!