Ubuntu in Windows Terminal closes with a WSL error code
WslRegisterDistribution failed with error: 0x8007019eShort answer
The error code tells you what is off. 0x8007019e means the Windows Subsystem for Linux feature is not enabled. 0x80370102 means virtualization or the Virtual Machine Platform is off. 0x80040154 means a Windows update switched the feature off. Enable it, restart, then reopen Ubuntu.
Fix it fast
1Find out which cause you have
In an elevated PowerShell, check whether the WSL feature is on, and read the exact code in the Ubuntu window.
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux2Match what you see, then jump to its fix
- 1
WslRegisterDistribution failed with error: 0x8007019eThe Windows Subsystem for Linux feature is offFix - 2
Error: 0x80370102 The virtual machine could not be started because a required feature is not installed.Virtual Machine Platform or virtualization is off (WSL 2)Fix - 3
Error: 0x80040154 after a Windows update, though Ubuntu worked beforeA Windows update turned the feature offFix - 4
Installation failed with error 0x80070003The distro is stored off the system drive (0x80070003)Fix
- 1
What does the error look like?
WslRegisterDistribution failed with error: 0x8007019eError: 0x80370102 The virtual machine could not be started because a required feature is not installed.Error: 0x80040154
Cause 1 of 4
The Windows Subsystem for Linux feature is off
1Check
Microsoft's guide says this code means the optional component is not enabled.
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux2Fix
Turn the feature on and restart Windows.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux3Verify
After the restart, Ubuntu starts from Windows Terminal.
wsl.exe -l -vConfirmed by learn.microsoft.com
Cause 2 of 4
Virtual Machine Platform or virtualization is off (WSL 2)
1Check
Microsoft lists three things: virtualization in the BIOS, the Virtual Machine Platform feature, and the hypervisor launch type. A hypervisorlaunchtype of Off means the hypervisor is disabled.
bcdedit /enum | findstr -i hypervisorlaunchtype2Fix
Enable virtualization in the BIOS, turn on Virtual Machine Platform under Windows features and restart, and if the launch type is Off, set it to Auto from an elevated PowerShell. In a virtual machine, enable nested virtualization on the host.
bcdedit /set hypervisorlaunchtype Auto
# on a Hyper-V host, for a guest VM:
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true3Verify
Restart Windows, then start the distro.
wsl.exe -d UbuntuConfirmed by learn.microsoft.com
Cause 3 of 4
A Windows update turned the feature off
1Check
Microsoft says the WSL feature can be disabled during a Windows update, and that you must enable it again.
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux2Fix
Re-enable the WSL feature as in the first cause, restart, and update WSL.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
wsl.exe --update3Verify
Ubuntu opens from Windows Terminal.
wsl.exe -l -vConfirmed by learn.microsoft.com
Cause 4 of 4
The distro is stored off the system drive (0x80070003)
1Check
WSL only runs from the system drive, usually C:. A distro placed on another drive fails with this code.
wsl.exe -l -v2Fix
Set the place where new apps are saved back to the system drive (Settings, System, Storage, Advanced storage settings, Where new content is saved), then install the distro again.
# no command: this is a Windows Settings change3Verify
The install completes.
wsl.exe -l -vConfirmed by learn.microsoft.com
How do I stop it coming back?
- Check that WSL is still enabled after a large Windows update.
- Keep WSL current with wsl.exe --update.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
dnf cannot install MySQL on Amazon Linux 2023
dnf cannot find a mysql-server package on Amazon Linux 2023
Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.
3 causes, each with a fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fixServers
Apache returns 504 Gateway Timeout when PHP takes too long
Quick requests work, slow ones end in a 504 after a fixed wait
A 504 from Apache means the backend did not answer within the proxy timeout.
2 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
Apache warns that a ${VAR} config variable is not defined
${VAR} left unchanged in the configuration, with a warning in the error log
Apache expands ${VAR} from Define or from the shell environment that exists when the server starts.
3 causes, each with a fix