You will need Windows 10 build 18917 or higher to be able to use WSL 2. Please note, you will need to have the Powershell Administrator window up. If you are converting WSL 1 to WSL 2 I’d assume you have Linux Subsystem for Windows installed. If not, the following command will install it for you.
1 |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux |
Once you do that you will need to run
1 |
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform |
Now you should be able to run, substitute <Distro> with your specific distribution. You can get a list by using the command: wsl --list --verbose .
1 |
wsl --set-version <Distro> 2 |
For setting all future distributions to use WSL 2, you will need to use the following command:
1 |
wsl --set-default-version 2 |
Now the last step is to verify your changes worked:
1 |
wsl --list --verbose |