Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Ubuntu in Windows Terminal closes with a WSL error code

ErrorWslRegisterDistribution failed with error: 0x8007019e

Short 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.

  • Applies to Windows 11, WSL 2, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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-Linux
  2. 2Match what you see, then jump to its fix

    1. 1WslRegisterDistribution failed with error: 0x8007019eThe Windows Subsystem for Linux feature is offFix
    2. 2Error: 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. 3Error: 0x80040154 after a Windows update, though Ubuntu worked beforeA Windows update turned the feature offFix
    4. 4Installation failed with error 0x80070003The distro is stored off the system drive (0x80070003)Fix

What does the error look like?

  • WslRegisterDistribution failed with error: 0x8007019e
  • Error: 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-Linux

2Fix

Turn the feature on and restart Windows.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

3Verify

After the restart, Ubuntu starts from Windows Terminal.

wsl.exe -l -v

Confirmed by learn.microsoft.com

Did this fix it?

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 hypervisorlaunchtype

2Fix

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 $true

3Verify

Restart Windows, then start the distro.

wsl.exe -d Ubuntu

Confirmed by learn.microsoft.com

Did this fix it?

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-Linux

2Fix

Re-enable the WSL feature as in the first cause, restart, and update WSL.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
wsl.exe --update

3Verify

Ubuntu opens from Windows Terminal.

wsl.exe -l -v

Confirmed by learn.microsoft.com

Did this fix it?

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 -v

2Fix

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 change

3Verify

The install completes.

wsl.exe -l -v

Confirmed by learn.microsoft.com

Did this fix it?

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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.