What does error 0x8007019e mean in WSL
Error 0x8007019e (with the human-readable description "Invalid registry data") occurs when Windows Subsystem for Linux (WSL) cannot properly read or interpret data about registered distributions in the Windows registry. It typically appears when attempting to launch a distribution from the command line (wsl, wsl <distribution>), PowerShell, or via a shortcut in the Start menu. Instead of launching the Linux environment, you see an error message. The problem may arise after a major Windows update, system crash, or improper termination of WSL.
Causes
The cause is almost always corruption or absence of critical registry entries in the HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss branch (for the current user) or HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss (for all users). Specific scenarios:
- Faulty Windows update. The update process may overwrite, delete, or "break" the registry key structure responsible for WSL.
- Manual deletion or moving of the distribution folder. A WSL distribution is stored in a virtual file system (a VHDX file for WSL2) or in the
Packagesfolder. If you move or delete this folder without updating the corresponding paths in the registry, WSL will not be able to find it. - Corruption of WSL system files. Damage to files of the
Windows Subsystem for Linuxcomponent (e.g.,lxssmanager.dll) can lead to an error when reading the registry. - Access rights conflict. The current user or the WSL service lacks permissions to read certain keys in the specified registry branch.
Solutions
Method 1: Basic reboot and component check
This is the simplest step, which solves the problem in rare cases of "stuck" states.
- Completely shut down WSL. Open PowerShell as administrator and run:
This command stops the background service (wsl --shutdownLxssManager) and all running distributions. - Restart your computer. After rebooting, try launching the distribution again. If the error persists, move to the next step.
- Ensure the component is enabled. Go to Control Panel -> Programs and Features -> Turn Windows features on or off. Find "Windows Subsystem for Linux" and "Virtual Machine Platform". Both must be enabled. If you toggled them — restart your PC.
Method 2: Manually restore registry entries (if the distribution is present)
If your distribution's folder (e.g., Ubuntu) physically exists on disk, you can try to restore the link by creating the missing registry entry. Caution: Working with the registry requires care.
- Find the installation path of the distribution. Typically for WSL2, the path looks like:
Or for WSL1:C:\Users\<YourUsername>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu...\\LocalState\
Inside, there will be a folder with the distribution's name (e.g.,C:\Users\<YourUsername>\AppData\Local\Lxss\Ubuntu) or anext4.vhdxfile (for WSL2). Remember the full path. - Back up the registry branch. In the Registry Editor (
regedit), navigate toHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss. Right-click theLxssfolder -> Export. Save the.regfile in a safe location. - Delete all subkeys (Key) inside
Lxss. Right-click each subkey with the long GUID name and select Delete. This will reset all distribution records for the current user. - Restart WSL. In PowerShell, run:
WSL will automatically attempt to detect installed distributions by their folders and re-register them in the registry. If the distribution is found, it will appear in the list (with statuswsl --list --allStopped). Try launching it.
Method 3: Clean import of the distribution via tar archive
If you have a previously exported tar archive of the distribution, this is the cleanest recovery method.
- Export (if you can still run it on another PC). On a working computer where the distribution runs, execute:
wsl --export <DistributionName> C:\path\to\backup\copy\ubuntu.tar - Import on the problematic PC. On the affected computer where the distribution won't start, but you have its data folder (e.g.,
ext4.vhdx) or you created an archive:wsl --import <NewName> C:\path\to\installation\folder C:\path\to\ubuntu.tar<NewName>— any name under which the distribution will be registered (e.g.,Ubuntu_Fixed).- The second command will create a completely new registry entry and its associated file structure. The old corrupted entry will be ignored.
Method 4: Complete reinstall of WSL and distributions
If none of the previous methods helped, or you have no backup, you'll need to start from scratch.
- Uninstall the WSL component. Open "Turn Windows features on or off" and uncheck "Windows Subsystem for Linux". Click OK and restart your computer.
- Manually remove leftovers (optional but recommended). After rebooting, delete the folders:
C:\Users\<YourUsername>\AppData\Local\Packages\(all folders starting withCanonicalGroupLimited,Microsoft.Windows.Linux, etc.)C:\Users\<YourUsername>\AppData\Local\Lxss\(if it exists)C:\Program Files\WindowsApps\(folders related to Store distributions). Caution: This may affect other Store apps.
- Enable the component again. Go back to "Turn Windows features on or off" and check "Windows Subsystem for Linux". Restart your PC.
- Reinstall the distribution. Download the desired distribution (e.g., Ubuntu) from the Microsoft Store or install via command line:
This will create a completely clean registry entry and a new file system.wsl --install -d Ubuntu
Prevention
To avoid a recurrence of error 0x8007019e in the future:
- Do not manually move or delete distribution folders (
Packages\...,Lxss). Always use thewsl --unregister <Distribution>command or Windows settings to remove a distribution. - Regularly create backups of important distributions. Use the
wsl --exportcommand. This saves all files and settings into a single portable tar archive. - Before major Windows updates (e.g., upgrading to a new version), export all critical distributions. After the update, if issues arise, you can quickly import them back.
- Avoid interrupting WSL operation (the "Detach" button in the console, force-killing the
vmmemprocess). Always exit sessions correctly (exitin the Linux terminal orwsl --shutdown).