Win 10 WSL won't set default 2

Viewed 26060

Completely new to developing on windows (as my mac is in for repair) and I'm trying to follow these instructions https://docs.microsoft.com/en-us/windows/wsl/install-win10

But while I seem to have an adequate version, my wsl does not seem to have the right option. I have installed the wsl update, but was not asked for elevated privaledges while doing so. Any ideas?

enter image description here

5 Answers

Make sure virtualisation is enabled in your BIOS by going to Task Manager -> More Details -> Performace -> CPU and an option called Virtualisation should be set to enabled. If it isn't enabled then go to your BIOS and enable SVM Mode on AMD CPUs or Intel Virtualisation Technology on Intel CPUs.

next, make sure WSL is enabled by running this in powershell:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

and that the virtual machine feature is enabled by running this:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart your computer. Then, go to the microsoft store and download your distro of choice. Then, set your default distro by running

wsl --setdefault <DistributionName>

and enable WSL 2 by running

wsl --set-default-version 2

again. If this doesn't work, run wsl --help and make sure --set-default-version is listed. If it isn't listed, your operating system does not support it and you need to update. If it throws this error:

WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel

Update here and run the MSI update package.

Also @Simon H

I faced similar issue when updating to wsl2, You may also keep both wsl1 and wsl2, Once you have wsl1, Follow the guidelines as posted by @ahsan-a, update to wsl2

Have a new/separate linux distro installed for wsl2, Like this

enter image description here

Then you may easily switch between wsl1 and wsl2 like this

enter image description here

Observe the state, I just do start-> type the name of linux distro.

Next to make new distro default, Just supply as shown below

enter image description here

If anyone is stuck on this issue and they have tried the above solutions, I would give wsl --set-version <distro_name> 2.

In some cases wsl2 doesn't work.

if your wsl machnine doesn't start deinstall your machine and set the default parameter to

wsl --set-default-version 1

and reinstall your wsl machine

Related