WSL "WslRegisterDistribution failed with error: 0x80370102": turn on virtualization
Fix WSL "WslRegisterDistribution failed with error: 0x80370102": enable virtualization in the firmware, Virtual Machine Platform, the hypervisor or nested virtualization.
by OhSudo ··
You install Ubuntu in WSL, and it stops on the first run:
WslRegisterDistribution failed with error: 0x80370102Error: 0x80370102 The virtual machine could not be started because a required feature is not installed.Newer versions of WSL may say it another way:
Wsl/Service/RegisterDistro/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLEDWSL 2 runs a real Linux kernel in a lightweight virtual machine. The error means that machine can’t start, because something it needs is switched off. There are four usual suspects, and one of them is outside Windows: the firmware.
- FirmwareCPU virtualization (VT-x / AMD-V)enables
- Windows featuresVirtual Machine Platformenables
- Hypervisorstarted at bootruns
- WSL 2 virtual machinecan't start: 0x80370102(breaks here)
TL;DR
In an administrator PowerShell:
systeminfo | Select-String "Virtualization|Hyper-V|hypervisor"dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartdism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartbcdedit /set hypervisorlaunchtype autoRestart. If systeminfo said virtualization is off in the firmware, enable it there too (section 2).
1. See what’s missing
systeminfo | Select-String "Virtualization|Hyper-V|hypervisor"Two kinds of answers:
Hyper-V Requirements: Virtualization Enabled In Firmware: NoThat points at section 2. Or:
Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.That means the hardware side is fine, and a hypervisor is running. The Performance tab in Task Manager shows the same thing: CPU → Virtualization: Enabled.
2. Enable virtualization in the firmware
If it’s off, no Windows setting will help. Restart, enter the BIOS/UEFI setup (usually F2, F10, F12 or Del during boot), and look for:
- Intel VT-x or Intel Virtualization Technology, on Intel machines;
- SVM Mode or AMD-V, on AMD machines.
It’s often under Advanced, CPU Configuration or Security. Enable it, save, and restart.
3. Enable the Windows features
WSL 2 needs Virtual Machine Platform, which is separate from WSL itself:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartdism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartRestart, then bring WSL up to date and try again:
wsl --updatewsl --set-default-version 2wsl --install -d Ubuntu4. The hypervisor is turned off
Some guides, and some older emulators and virtualization tools, turn off the Windows hypervisor at boot. Features can then be on, and WSL still fails. Check:
bcdedit /enum | Select-String hypervisorlaunchtypeIf it says Off, turn it back on and restart:
bcdedit /set hypervisorlaunchtype auto5. Windows itself runs in a virtual machine
Then the machine has to pass virtualization through to Windows. This is nested virtualization, and it’s set on the host, with the VM powered off.
On a Hyper-V host:
Set-VMProcessor -VMName "MyWindowsVM" -ExposeVirtualizationExtensions $trueIn VMware, enable Virtualize Intel VT-x/EPT or AMD-V/RVI in the VM’s processor settings. In VirtualBox, it’s Enable Nested VT-x/AMD-V.
In the cloud, it depends on the machine type: on Azure, choose a size that supports nested virtualization. If a provider doesn’t offer it, use WSL 1 (next section).
6. When you can’t enable it: WSL 1
WSL 1 doesn’t use a virtual machine, so none of this applies:
wsl --set-default-version 1wsl --install -d Ubuntuwsl --list --verboseIt’s a real option for scripts and command-line tools. It has no real Linux kernel, though, so Docker and other programs that rely on kernel features won’t run in it.
Warning
A failed install can leave a half-registered distribution behind. If the error stays after the fix, remove it with wsl --unregister Ubuntu and install again. That command deletes the distribution’s files, so only use it when there’s nothing in it to keep.
Shell, we have a problem!
Similar, but different: 0x8007019e means the Windows Subsystem for Linux feature isn’t enabled at all. 0x800701bc means the WSL 2 kernel needs updating: run wsl --update. 0x80370114 usually means a Windows security setting blocks the virtual machine (the Exploit Protection control flow guard override for vmcompute.exe). For virtual machines under Hyper-V, see the hypervisor is not running. For Docker Desktop’s own message, see WSL 2 installation is incomplete.
Found this useful? Share it.
Found a mistake? Let us know at contact@ohsudo.com.