WSL 2 uninstalled itself
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.
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.
Calling wsl just hangs the process. So I literally have no idea.
Might as well need to reinstall WSL with the Ubuntu distro all together.
We don't know what's the problem until collect-wsl-logs
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 :(
Okay, sent.
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:
- 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
- Hyper-V problem introduced by Windows update. Sometime disable Virtual machine platform, reboot, then re-enable it may helps.
- WSL itself. disable Windows subsystem for Linux feature, then enable it.
- 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.
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.
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 :(
Try restart lxssmanager first from task manager.

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.
Well, now it hangs on stopping ๐ค
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.
I might have found the culprit:

It seems that BOINC client I installed to help with projects development is holding the lxss processes.
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.
Had this too, issue seemingly resolved itself after several reboots over the course of a week or so.
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!