Completely new to developing on windows (as my mac is in for repair) and I'm trying to follow these instructions https://learn.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?
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
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
Then you may easily switch between wsl1 and wsl2 like this
Observe the state, I just do start-> type the name of linux distro.
Next to make new distro default, Just supply as shown below
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
Step by step resolution for the issue.
Step 1: Make sure virtualization is enabled in your BIOS.
Task Manager -> More Details -> Performance -> CPU -> Virtualization > -> "Enabled"
Step 2: Open "Windows Features" from start menu and make sure "Virtualization Machine Platform" and "Windows Subsystem for Linux" is checked
Step 3: From PowerShell, to see available distros in machine use
wsl --list --verbose
Step 4: To set WSL default version to 2 use
wsl --set-default-version 2
Step 5: To set the appropriate distro to wsl 2, use
wsl --set-version 2
In case in Step 5, you encounter the error WSL 2 requires an update to its kernel component
. Download and install MSI update package from official MS site . Once update is installed, restart and continue from step 4.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.