WSL: Installing Any Distro on WSL2 Fails with "WslRegisterDistribution failed with error: 0x80070002"
Your Windows build number: Microsoft Windows [Version 10.0.19041.207]
What you’re doing and what’s happening:
- Updated to Release Preview Ring Version 10.0.19041.207
- Installed kernel from https://aka.ms/wsl2kernel
- Upgraded current Debian WSL1 distro to WSL2 with wsl --set-version Debian 2`
- On reboot, Debian starts failing with
Error: 0x80070002 The system cannot find the file specified. - Tried to unregister Debian with
wslconfig /u Debianthen reinstall it. Launching Debian from Store leads to same errorWslRegisterDistribution failed with error: 0x80070002.
What I’ve tried:
- Uninstall Debian, restart, remove WSL, restart, add WSL, restart, install Debian from Store
- Installing Debian manually
- Installing Ubuntu instead
- Tried the solution from #4618 (Null service)
- Tried restarting
LxssManager(interestingly, I also have two other servicesLxssManagerUser_3c782and MessagingService_3c782``.
Output of wslconfig /list /all:
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
However, in Microsoft Store, Debian is installed. When I click Launch, it leads to the same WslRegisterDistribution failed with error: 0x80070002 .
- What’s wrong / what should be happening instead:
If I try to initialize any distro by clicking Launch from the store or starting the app, I get
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...
It should just allow me to install a new distro.
-
Strace of the failing command, if applicable: (If
some_commandis failing, then runstrace -o some_command.strace -f some_command some_args, and link the contents ofsome_command.stracein a gist here). -
For WSL launch issues, please collect detailed logs.
lxcore_logs.zip - when trying to launch Debian
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 42 (2 by maintainers)
Hi,
Just saw the report on the launchpad. That bug on launchpad is more related to an external drive installation issue. It could be related, and I will look into it.
On the same time, can you try to do the following to see if that works?
I followed the instructions (wpr -start wsl.wprp) at the bottom of this page … https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-detailed-logs and thereby got the decisive hint that I could get rid of this problem, which I have been stuck with for a few weeks.
The file that was not found is my custom kernel file that I used in previous installations (and also on another computer / Windows installation, but possibly restored by Microsoft account …) - the bzImage
I specified this path in a .wslconfig file. I commented out the bold line below, ran the command again, and the conversion from WSL1 to WSL2 was successful.
[wsl2] #kernel=%userprofile%\bzImage memory=3GB processors=1 localhostForwarding=false swap=2.25GB swapFile=%USERPROFILE%\AppData\Local\Temp\swap.vhdx #pageReporting=true #idleThreshold=1
Hopefully this will help someone.
I can not found “.wslconfig” in directory, why?
Dear you all, I had a similaire issue. See
A lot of answers on the web are not efficient. Especially the answers saying to uninstall windows updates (KB…).
The “good idea” came to me while reading this github issue comment
The trick was to start the Linux distribution installation (in my case, Ubuntu 20.04) using the microsoft store. Very quickly you have to edit the “vEthernet (WSL)” ETH adapter via your windows control pannel. There were a red cross on the adapter. And then I dissabled all particular pluggins / filters (that I got from Camera / Vision sensors libraries, in my case TeliGev Driver and UEYE driver). After applying the changes, a green check appeared on the adapter and the Linux installation could end correctly.
Maybe this can help you. B.R.
I encountered same problem today after rebooting my computer after a long time and noticed I didn’t have Ethernet for WSL on my network settings, after removing WSL feature from Windows and rebooting system and re adding it back to system fixed my problem, noticed Ethernet for WSL is back in my adapters.
I’m certain it’s related with Ethernet for WSL is missing.
Thank you! After 3 hours I finally made it work. Apparently there was this line “kernel=C:\temp\myCustomKernel” in my .wslconfig file and that was causing the problem. I deleted it and now wsl sees my actual kernel.
I just deleted the
.wslconfigfile in the user directory, which seemed to be some kind of sample, and it worked.Commenting out all lines except “[wsl2]” in my C:\Users\vincent_chu\.wslconfig solve this problem. Now there is no 0x80070002 error and WSL2 works fine. Hopefully this will help.
@jamestalbot3 Thanks, already noticed relation to the resolv.conf #5336
Same here, on AMD Brazos PC Updated Win10 to version 2004, updated wsl to v2. Unregistered my old Ubuntu 18.04 for wsl v1. Restarted. Set default version to 2. Installed Debian from the store.
The logs are attached.
Then set default back to v1 and the debian installed successfully.
logs.zip
Adding more data here, I had this issue as well and following @patrick330602’s steps seemed to work from me.