microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.34k stars 814 forks source link

WSL not working after update from Microsoft store #8260

Closed spurani closed 2 years ago

spurani commented 2 years ago

Version

Microsoft Windows [Version 10.0.19044.1586]

WSL Version

Kernel Version

5.10.16

Distro Version

Ubuntu20.04LTS

Other Software

Docker Desktop (Windows), version 4.6.1 (76265) Docker Engine v20.10.13

Repro Steps

I already had WSL installed from Microsoft Store few days and it was working fine. I got an update about the WSL from Microsoft Store and I updated it then it stopped working.

Expected Behavior

bash shell. Windows Subsystem for Linux is already installed so it should operate normally.

Actual Behavior

Hello I had successfully installed WSL few days ago and everything was working fine. But after the I got an update regarding WSL from Microsoft Store I updated WSL and since then it is throwing this error. I also restarted the computer and checked to make sure my Virtual Machine Platform and Windows Subsystem for Linux are ON and I found out that both of these services were already ON. still I get the same error. May I please get any guidance on this one? as I have to use WSL for my educational purpose that would be really helpful thanks

Installing, this may take a few minutes... WslRegisterDistribution failed with error: 0x80070050 Error: 0x80070050 The file exists.

Press any key to continue...

Diagnostic Logs

No response

cnemelka commented 2 years ago

same issue here. Please take a look at this. I know there is the workaround but, really, when will Microsoft stop breaking stuff with updates?????

xygdys commented 2 years ago

try https://github.com/microsoft/WSL/issues/8258#issuecomment-1094081305

cnemelka commented 2 years ago

try #8258 (comment)

I just fixed the entry in the terminal settings to use "bash.exe" for now. The issue isn't the workaround, it's the sheer number of screw-ups that seem to continue to plague Microsoft updates

spurani commented 2 years ago

when I am running wsl.exe from start menu its working fine but when I am opening the actual Ubuntu application from start menu its not working image

I am not willing to uninstall it as I run anaconda and Docker from WSL. But not sure how long can I wait to get this fixed? or I can just use wsl.exe what difference it is going to make

xygdys commented 2 years ago

anyway, turn off automatic updates in the Microsoft Store

yoru-is-baam commented 2 years ago

So the problem here is the new Ubuntu version in the Microsoft store is wrong right?

1cekrim commented 2 years ago

Try running the distro with "wsl.exe -d Ubuntu20.04LTS" instead of "ubuntu2004.exe". I solved the problem this way

yoru-is-baam commented 2 years ago

I tried running the distro with "wsl.exe -d Ubuntu20.04LTS" like 1cekrim told and it worked but when I ran only ubuntu2004 then it was still wrong

fabricevidal commented 2 years ago

I had the same problem here after an update. As pointed out above changing from ubuntu2004.exe to wsl.exe -d Ubuntu20.04LTS did the trick. However this is clearly not an acceptable workaround. WSL should never break like that after an update. So please fix this.

spurani commented 2 years ago

I have also put up in https://askubuntu.com/questions/1401830/wsl-not-working-after-update-from-microsoft-store?noredirect=1#comment2432937_1401830 I hope this issue gets escalated and reaches to their tech support for fix asap. I think lot of people are more worried about their docker environment and anaconda including myself. Along with this I have also mentioned the issue on Microsoft Store app in this applications feedback as rating and reviews I gave them 1 star. Many more less ratings would definitely escalate

NotTheDr01ds commented 2 years ago

@spurani A few notes:

NotTheDr01ds commented 2 years ago

For anyone having this issue, please see my answers to the OP's question on Ask Ubuntu. And please let me know the results so that I can update the answers accordingly.

NotTheDr01ds commented 2 years ago

So the problem here is the new Ubuntu version in the Microsoft store is wrong right?

Actually, it appears that the previous "Ubuntu 20.04" version in the Store was wrong. It should have had the distribution name, Ubuntu-20.04, but for some reason it got renamed to Ubuntu20.04LTS. Canonical "fixed" it in the latest version by changing the distribution name back to what it should be, but that broke things if you happened to have installed the "bad" version.

kodikos commented 2 years ago

@NotTheDr01ds I had upgraded from a wsl1 "Ubuntu" distro to wsl2 "Ubuntu-20.04" a while back when wsl2 came out. I deleted the old wsl1 ubuntu on a clean-out and everything was okay, but a couple of days ago it wouldn't boot the 20.04. I thought I borked the 20.04 removing the old wsl1 distro! I manually pulled my files out the vhdx (latest 7-zip is your friend!). Then I unregistered my ubuntu-20.04 to try and reinstall today. It's not happening, getting the Error: 0x80070050 The file exists. running ubuntu2004 or wsl -d Ubuntu-20.04. If I run ubuntu.exe I get Error: 0x8007045b A system shutdown is in progress.. Checked the Lxss reg, there is a defaultDistribution pointing at a guid (a docker distro), and DefaultVersion: 2.

NotTheDr01ds commented 2 years ago

@kodikos So just one distro (the Docker one), showing in the registry, right? Does the 0x8007045b occur after reboot? I might could see the "state" being bad after encountering the 0x80070050.

but a couple of days ago it wouldn't boot the 20.04.

While most users are having problems after the "fix" of the Store Ubuntu, I have a feeling you are one of the ones who initially ran into this problem while the "bad" version was on your system. That means that an `--unregister might not have "fully worked". It probably removed the registry keys, but it sounds like it left the installation on your system. Just guessing here from what I'm "visualizing" of the problem so far, but let's see if we can confirm ...

Check for the remnants of a %userprofile%\AppData\Local\Packages\CanonicalGroup...Ubuntu... directory on your system (maybe more than one).

Assuming that you don't have any other distros showing up in the registry (or via wsl -l -v), then try to move or rename those directories. It might not let you due to permissions, and if not, then at least try to move the ..\LocalState\ext4.vhdx out of there. Once it's gone, try the reinstall again.

Side note -- I monitor the Stack Exchange sites more frequently than Github, so if you want to post there (Ask Ubuntu or Super User), I'll see it as long as it is tagged "windows-subsystem-for-linux".

But I'll try to check back here occasionally as well.

deanRealtair commented 2 years ago

@NotTheDr01ds your fix worked for me. I usually stay away from regedit, but this was simple enough. Thanks mate!

benhillis commented 2 years ago

/dupe #8257

ghost commented 2 years ago

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

Skipfx commented 9 months ago

Start internet connection sharing service