Win 10 WSL won't set default 2
Solution 1:
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.
Solution 2:
After following @ahsan-a's answer, make sure to complete the last step,Set your distribution version to WSL 1 or WSL 2:
On Powershell:
wsl --list --verbose
Then:
wsl --set-version <distribution name> 2