WSL: Installing any distro fails with "WslRegisterDistribution failed with error: 0x80070002 Error: 0x80070002 The system cannot find the file specified."

Hi,

After installing Windows 10 on my desktop, I installed the Debian distribution. Right after installation, it loaded and worked fine, however after closing the shell and re-opening it, it got stuck while loading and my CPU usage increased to 100% - in the services I could see around 8 processed called “init” that were running and using up all cpu resources. I wasn’t able to kill the processes, only a reboot helped. As the processes came back every time I opened the Debian shell, I eventually deinstalled the disto. Now, when I try to install any distro, I always end up with the same error:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070002
Error: 0x80070002 The system cannot find the file specified.

Press any key to continue...

I tried all possible combinations of deinstalling, reboot, etc. wsllist never shows any of the Distros, even if they show up in the installed programs.

wsl --list --all
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

Attached you can find my logs - I was collecting them while I tried to install the Ubuntu distribution.

logs.zip

Windows version: Win 10 Pro, Version 1909 Build 18363.657.

Please let me know if you require anything else!

Thank you, Kerstin

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 6
  • Comments: 68

Most upvoted comments

I have the same issue on 21H1 Build 19043.1237. I tried wsl --set-default-version 1 and this works for me.

I just managed to fix this, but am unsure of the exact underlying issue, or what caused it (the original issue was Docker Desktop failing to start with various random errors).

Firstly I noticed the comment above about a possible link to network adapters. I noticed I had a “VMWare Bridge Protocol” attached to my ethernet adapter, probably left over from an old VMWare Player install, but I was unable to remove/uninstall it (0x8007007E error).

I then did a Network Reset in Windows, which broke all my networking, the adapters had the error “Windows is still setting up the class configuration for this device, Code 56” which is relatively obscure, and again apparently related to an incompatible underlying driver. This error seems to be impossible to solve by a user (ie. through the normal Windows UI) except by a system restore or something. I was only able to fix it by running the CCleaner software (free version), and accepting all it’s recommendations in the registry clean section.

After a reboot all the networking worked fine again, and I was able to install WSL2 and then reinstall Docker Desktop (which is what started me on the trail of fixing it all!)

for anyone still looking for solution here, try to delete the .wslconfig under your C:\Users\<your username>\.

I was able to get this resolved by removing the WSL kernel update from programs/features, and then removing the WSL feature, rebooting, and then re-enabling the WSL feature and rebooting. I also deleted my WSL instances during this process.

The only way I fixed this is by disabling WSL and re-enabling it again, I tried everything.

wsl --set-default-version 1 seems to work on build 2004

Error: 0x80070002 The system cannot find the file specified error

Here’s how I fixed it today! Thanks, everyone for this wonderful discussion above, it did help me to fix it!

  1. Install the free version of CCleaner and use it to fix the issues present in your system. I’ve used v6.09 at the time of doing CCleaner

  2. Check whether Windows feature windows subsystem for Linux is on. If not then turn it ON and restart your machine Windows feature

  3. From the windows store get your desired Ubuntu version and run it. Set your username and password. That’s all. Now it will work. solved

I just managed to fix this, but am unsure of the exact underlying issue, or what caused it (the original issue was Docker Desktop failing to start with various random errors).

Firstly I noticed the comment above about a possible link to network adapters. I noticed I had a “VMWare Bridge Protocol” attached to my ethernet adapter, probably left over from an old VMWare Player install, but I was unable to remove/uninstall it (0x8007007E error).

I then did a Network Reset in Windows, which broke all my networking, the adapters had the error “Windows is still setting up the class configuration for this device, Code 56” which is relatively obscure, and again apparently related to an incompatible underlying driver. This error seems to be impossible to solve by a user (ie. through the normal Windows UI) except by a system restore or something. I was only able to fix it by running the CCleaner software (free version), and accepting all it’s recommendations in the registry clean section.

After a reboot all the networking worked fine again, and I was able to install WSL2 and then reinstall Docker Desktop (which is what started me on the trail of fixing it all!)

Using CCleaner and cleaning registry helped me. Thanks

I encountered this issue today. I had Docker Desktop installed, I removed it but no luck starting with WSL Ubuntu 😦

Issue still appears in December.

Bumping this since it is really an issue and blocked the usage of WSL 2

I was able to fix this issue by using wsl.exe --set-default-version 1, and then wsl.exe --install <distro>. After this it worked like a charm, I was able to install the distros but I was limited to version 1, every time I wanted to wsl.exe --set-version <distro> 2 it gave me a different error. WSL version 1 doesn’t allow me to run Docker from within WSL. After a long time and checking other issues, I tried to update my WSL kernel and even this was unsuccessful. In the end, the folder C:\Windows\System32\lxss didn’t contain the lib folder and the kernel and license files under C:\Windows\System32\lxss\tools. I just grabbed those files from another WSL installation on another PC and got the issue fixed! 😁 I don’t know how those files went missing, but I assure you that disabling/enabling the Windows features such as Hyper-V, WSL, Windows Hypervisor Platform, and Virtual Machine Platform doesn’t fix the issue nor bring these files back.

Hope this helps. 😉

TLDR: Check if you have C:\Windows\System32\lxss\tools\(kernel/license) files and if not try grabbing them from another WSL installation into your PC.

Had same issue, tried a lot of suggestions, and was not resolved. Installed Microsoft Defender for Endpoint plug-in for Windows Subsystem for Linux (WSL), followed steps and did troubleshooting in microsoft-defender-for-endpoint I hope will be also fixed for others.

I just managed to fix this, but am unsure of the exact underlying issue, or what caused it (the original issue was Docker Desktop failing to start with various random errors).

Firstly I noticed the comment above about a possible link to network adapters. I noticed I had a “VMWare Bridge Protocol” attached to my ethernet adapter, probably left over from an old VMWare Player install, but I was unable to remove/uninstall it (0x8007007E error).

I then did a Network Reset in Windows, which broke all my networking, the adapters had the error “Windows is still setting up the class configuration for this device, Code 56” which is relatively obscure, and again apparently related to an incompatible underlying driver. This error seems to be impossible to solve by a user (ie. through the normal Windows UI) except by a system restore or something. I was only able to fix it by running the CCleaner software (free version), and accepting all it’s recommendations in the registry clean section.

After a reboot all the networking worked fine again, and I was able to install WSL2 and then reinstall Docker Desktop (which is what started me on the trail of fixing it all!)

After years of development, this WSL2 issue still hit my computer today. I tried all solutions proposed here and installing CCleaner was the only way. Thank you very much.

I got same problem. And I remembered that I uninstalled the VMware Workstation Player before the problem occur. So I tried to reinstall the VMware Workstation Player and it was solved. You could try to install VMware Workstation Player if it helps.

Could not find root cause of problem.

What achieved a successful install for me was to forgo using winget and just install from Microsoft Store.

Just to see if that cleared the root cause, used wsl --unregister, rebooted, then tried

winget install -e --id Canonical.Ubuntu

which resulted in

Installer failed with exit code: 0x80070002 : The system cannot find the file specified.

So maybe this is a winget issue and not a WSL issue.


A speculation of mine as to what I did that is the root cause is that I renamed a distribution by editing a distribution name as per https://superuser.com/a/1613251/125532

If you want to rename your WSL distro, you have to:

Stop all instances of WSL
Open Registry Editor and go to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss
Find the distro you want to rename, look for the DistributionName
Change it as you want
Start WSL again, you can also execute wsl.exe -l -v to check if it changes

As per https://github.com/microsoft/winget-cli/issues/1705 using Windows Event Viewer in branch

Applications and Services Logs/Microsoft/Windows/AppXDeployment-Server/Microsoft-Windows-AppXDeploymentServer/Operational

for tab: Details find error: 0x80073cf1

For more on the error code see: Troubleshooting packaging, deployment, and query of Windows apps

Error code: ERROR_INSTALL_PACKAGE_NOT_FOUND Value: 0x80073CF1 Description and possible causes: The package couldn’t be found. You may get this error while removing a package that isn’t installed for the current user.

for anyone still looking for solution here, try to delete the .wslconfig under your C:\Users\<your username>\.

Thanks @hguitar !

This method works for my end!

Same problem here!

As people are suggesting on #5107, I also think that it is related to the absence of vEthernet (WSL) adapter. No matter how much I try reinstalling WSL stuff in different order, there is no way the nic adapter being installed again.

Iv’e also tried to “manually” install the adapter via Hyper-V with no luck.😥

insider previews

unreliable

Well, it’s not like you weren’t warned about it. I don’t believe this is a valid reason to hate on WSL2.