Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install any distributions, WslRegisterDistribution failed with error: 0x80070002 #4618

Closed
owenworley opened this issue Oct 25, 2019 · 5 comments

Comments

@owenworley
Copy link

  • Your Windows build number: (Type ver at a Windows Command Prompt)
C:\Users\owen>ver
Microsoft Windows [Version 10.0.18362.10024]
  • What you're doing and what's happening:
C:\Users\owen>wslconfig /list /all
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

C:\Users\owen>ubuntu1804
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...
  • What's wrong / what should be happening instead:
I cannot install any distributions of Linux on Windows. 
I should be able to install Ubuntu or any other distributiuon.

I have tried the following suggestions already but they have not helped:

- Uninstall WSL feature, reboot, reinstall WSL feature, reboot
- Uninstall and reinstall (between reboots) all distributions of linux from the 
Windows Store, they all show the same error 0x80070002
- I have made sure windows content is set to install to C:\
- I have tried running "sfc /scannow" and rebooting
- I have tried running "DISM /Online /Cleanup-Image /Scanhealth" and 
nothing bad was reported
  • Strace of the failing command, if applicable:
I cannot strace as I am not using WSL yet.
I have attached `lxcore_kernel.etl` `lxcore_service.etl` `lxcore_user.etl` here:

lxcore_logs.zip

@benhillis
Copy link
Member

Thanks for the trace. We are attempting to open the "nul" device and that is failing with ERROR_FILE_NOT_FOUND. Do you have any third party AV or software that could explain this?

@owenworley
Copy link
Author

I use BitDefender and Malware Bytes. I have tried compeltely disabling these but it doesn't make a difference.

@owenworley
Copy link
Author

We are attempting to open the "nul" device

Genius!

I found the solution. A while back, I was having issues with my non-paged memry pool growing massively over time (usingup to my entire 32gb of ram). At the time, I was suggested to try a nuber of things, including setting the following reg key:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Null\Start to 4
And disabling the null service (sc config Null to disable and not start)

I just changed that reg key backl to 4, and ran from an elevated prompt:
sc config Null start= system
sc start Null

And now I just successfully installed Ubuntu and it works fine.

When I read you saying about 'nul' i immediately tried running echo hello> nul and saw the same message The system cannot find the file specified.

After reenabling the null service, i can run echo hello > nul with no errors.

Excellent! Than you so much for pointing me on the right track.

It might be useful though, for wsl to state the file that it cannot open in these cases, because if I had seen a message earlier like Failed to open 'nul'. The system cannot find the specified file I would have been able to self diagnose this months ago.

@spaceraccoon
Copy link

Hi @benhillis, could I know how you analyzed the log files to figure out the missing file? I'm trying to figure out a similar error for me. #5107

@HItzz07
Copy link

HItzz07 commented Apr 23, 2021

Used this "wsl --set-default-version 1" ,
It worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants