WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL 2 uninstalled itself

Open Polda18 opened this issue 6 years ago โ€ข 15 comments

Environment

Windows build number: Microsoft Windows [Version 10.0.20226.1000]
Your Distribution version: Linux Ubuntu (cannot post exact version)
Whether the issue is on WSL 2 and/or WSL 1: WSL 2 (as I installed it after I upgraded to Windows Insider)

Steps to reproduce

Well, I installed some updates and while I didn't use the WSL much, I definitely was able to at least see that Linux was still installed like just few days ago (although, I was unable to launch the Linux terminal inside Windows Terminal app). Now I tried it again to see that Linux has disappeared and was replaced with Microsoft Azure Cloud Shell (that thing definitely wasn't there before). I still can run WSL directly, but it doesn't do anything. I think I have lost my Ubuntu installation somehow.

WSL logs: None, or I cannot retrieve them somehow (or don't know about them).

Expected behavior

Start up Linux shell.

Actual behavior

Does nothing.

Polda18 avatar Oct 08 '20 11:10 Polda18

what's the output of wsl -l -v. 1, if you see Ubuntu is in the list, then you can try to install small distro like Debian to make sure WSL 2 is fine on your machine. 2. if you didn't see Ubuntu, backup the folder(my distro is Ubuntu20.04) like C:\Users\your\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState, then install the distro again, then recover the LocalState.

licanhua avatar Oct 08 '20 21:10 licanhua

Calling wsl just hangs the process. So I literally have no idea. image Might as well need to reinstall WSL with the Ubuntu distro all together.

Polda18 avatar Oct 08 '20 22:10 Polda18

We don't know what's the problem until collect-wsl-logs

licanhua avatar Oct 08 '20 23:10 licanhua

I accidentally sent bug report in wrong category. The thing is that I have Windows in Czech language, that makes it more difficult to pick the correct category sometimes. Now I have to wait until data collection is available again :(

Polda18 avatar Oct 09 '20 08:10 Polda18

Okay, sent.

Polda18 avatar Oct 09 '20 09:10 Polda18

I saw the two logs you submitted, but I didn't find anything interesting in WSL. There is no crash in the logs, so there is no issue I know may link to your issue.

You can first check if lxssmanager service is running, if not, start it. if yes, try to restart it. I would expect it hangs there.

If it hangs, I don't know what your problem is, so I just list some generic solutions:

  1. limited resources on cpu, disk and memory. You can check it from task manager and likely you may hit problem if any of problem is too busy
  2. Hyper-V problem introduced by Windows update. Sometime disable Virtual machine platform, reboot, then re-enable it may helps.
  3. WSL itself. disable Windows subsystem for Linux feature, then enable it.
  4. Hyper-V conflicts with VirtualBox or VMWare. I don't have experience on it, but I saw several cases user resolved WSL problem after they uninstalled VirtualBox/VMWare.

licanhua avatar Oct 09 '20 18:10 licanhua

Well, uninstalling VMware isn't and option for me since I use virtual machines with various OS, including Windows 98 and MS-DOS v6.22, and I actually have development version of VMware that supports Hyper-V.

The first 3 may actually help, so I'll try these out tomorrow.

Polda18 avatar Oct 09 '20 18:10 Polda18

So I tried number 1 and 3. From number 1 I cannot clearly say that that's the issue since CPU doesn't seem to be busy with wsl running. It just stops midway and hangs. Number 3 - tried to disable it and reenable it again and same issue.

Well, here's one thing: If I run wsl --set-default-version 2, it actually performs the action without any issue:

PS C:\Users\Marek Polรกฤek> wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2

Anything else just hangs the process. Didn't try out the number 4 for obvious reason that I need VMware for other virtual machines (I have Windows 98, MS-DOS and Windows 2000 virtual machine with VMware), and also didn't try out number 2 because I can't remember how can I do that :(

Polda18 avatar Oct 15 '20 13:10 Polda18

Try restart lxssmanager first from task manager.

image

number 2: turn off feature Virtual Machine Platform, reboot the machine, turn on it, reboot the machine.

hang is because of lxssmanager, but --set-default-version doesn't use lxss service.

licanhua avatar Oct 15 '20 18:10 licanhua

Well, now it hangs on stopping ๐Ÿค”

Polda18 avatar Oct 15 '20 18:10 Polda18

I have found other issues on the service hanging on stopping as well (#1086 and #2933) and it does seem to be a bug in latest Insider Build snapshot. Still not fixed though... I don't know how can I fix it. As a workaround, I'll have to use Ubuntu virtual machine I installed in VMware until this is fixed.

Polda18 avatar Oct 15 '20 19:10 Polda18

I might have found the culprit: image

It seems that BOINC client I installed to help with projects development is holding the lxss processes.

Polda18 avatar Oct 15 '20 20:10 Polda18

Any advice on whether suggestion 3 in this comment is safe with respect to existing data in WSL?

Also #4144 may be interest to those following this thread.

jsteenri avatar Nov 19 '20 04:11 jsteenri

Had this too, issue seemingly resolved itself after several reboots over the course of a week or so.

johnaoss avatar Apr 13 '21 19:04 johnaoss

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!