Today, I decided to upgrade from WSL 1 to WSL 2. On WSL 1, I had no issues getting both Kali or Ubuntu to function on WSL 1. When upgrading to WSL 2, both Kali and Ubuntu failed to upgrade to version 2. I read that uninstalling and reinstalling them could fix this issue. However, upon reinstalling both of them, my system now fails to detect any installed distro, despite the distro's being installed. Launching both Kali or Ubuntu gives the same error: Error 0x80370102 Screenshot
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80370102
Error: 0x80370102 The virtual machine could not be started because a required feature is not installed.
When researching this error, and from reading the official WSL 2 install guide from Microsoft, the error always seems to be because the system doesn't have virtualization enabled in the BIOS. This is really confusing as I have checked over 4 different times if I missed any virtualization setting in my BIOS, and have verified it is all enabled. I also have confirmed I have the NX feature enabled as well. Even HWiNFO detects I have virtualization enabled: Screenshot of HWiNFO's results
I have also made sure that the Virtual Machine Platform, Windows Subsystem for Linux and the Windows Hypervisor Platform features are all enabled. Not only this, but I can also create and run any number of VMs from VirtualBox without any errors or issues whatsoever.
Other troubleshooting steps I have gone through was resetting the WSL service, reset my machine (multiple times), update the WSL kernel, verify my Win version is in 19041 or above, and waited 20 minutes after boot to see if I was just being impatient.
Here is some information about my system:
- Running Windows 10 ver 10.0.19041.388 (also known as SDK version 2004)
- Ryzen 3900x CPU
- 32GB DDR4 RAM
- Asus Tuf Gaming X570-Plus Motherboard w/ BIOS ver 1407
FIRST you need to make sure you have enabled CPU virtualization in your BIOS. These instructions will depend on your hardware.
For AMD CPUs, you will look for a feature called: "AMD (AMD Secure Virtual Machine, AMD SVM)"
For Intel CPUs, you will look for a feature called: "Intel (Intel Virtualization Technology, Intel VT-x)"
Here are the instructions for setting SVM on my computer. Note: this is for a MSI motherboard.
Go to advanced settings.
Go into the overclocking section.
Go into the CPU Features section
Toggle the CPU feature "SVM Mode" which enables CPU virtualization.
SECOND you are going to have to enable the Hyper-V Windows feature.
Here are my instructions (Note feel free to duckduckgo/google this separately):
Search for "Windows Features" in your taskbar.
Then look for "Hyper-V". Then enable it.
At this point you should be done and no longer get this error.
I has fix this problem running code below and rebooting system.
It worked for me after I disabled "Virtual Machine Platform" and restart Windows. Then I turned it on again and rebooted Windows again.
This is from the May 2020 release notes:
It looks like Dism never knows when a feature is really enabled so you need to try several times until it works.
I found the solution on GitHub and some quotes were taken from there https://github.com/microsoft/WSL/issues/4120 it was just difficult for me to find a solution and therefore I am writing here here.
I had the same error and with the virtualization enabled too. After uncheck Windows Subsystem for Linux, Windows Hypervisor Platform and Virtual Machine Platform, restarting the pc and enable them again the error disapeared and I could install WSL 2.
you have to enable virtualisation in BIOS. There is no other way. I spent 2 hours with MS adviser on it. We done everything and ended with no success. I saw somewhere later that BIOS setting advice. It works! Virtualisation is disabled there. Once enabled Ubuntu works.
I had been trying for months to get WSL 2 working. Upgrading my existing "Ubuntu" installation from WSL 1 never worked.
sudo rm /etc/resolv.conf && sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf' && sudo chattr +i /etc/resolv.conf
(from https://github.com/microsoft/WSL/issues/4844#issuecomment-765248581) was hugely helpful (because https://github.com/microsoft/WSL/issues/5336#issuecomment-653881695 didn't quite work, and that file and kept getting overwritten).Bryan's answer was similar but required uninstalling / unchecking even more.
Oh! I found it. In "add / remove functionnalities", you have Hyper-V and something else about virtualization. That one was missing. I only have the french translation of this func. so giving it to you won't probably help. Look for the entire list and double-check. Actually hyper-v is not required. Debian up and running.