1

Usually, WSL2 runs fine, but maybe once a month or two, it becomes completely unresponsive and I'm not sure why. Usually restarting the entire computer fixes it, but I'd like to know if there is any way to troubleshoot this and, ideally, prevent it from happening. I also want to know if this could be caused by system corruption.

There's a lot of information in this post, but I attempted arrange it in order of importance. Please be aware the bullet points are numbered in the order in which I wrote this post: "Symptoms", "System Information", then "30-60 minutes later".

Symptoms:

  1. When I attempt to run wsl.exe in powershell/cmd.exe, the command hangs:

    cmd.exe

    I've been waiting for this to do something for over 10+ minutes now. The same thing occurs via attempt to wsl.exe --shutdown:

    powershell

  2. When I start a WSL terminal, it opens a window, but it is similarly unresponsive:

    WSL Terminal

  3. I don't normally open a WSL terminal directly. Usually I open mintty.exe/wsltty via a shortcut that runs this command: %LOCALAPPDATA%\wsltty\bin\mintty.exe --tabbar=4 -o "KeyFunctions=t:new-window-cwd;w:close" --WSL="Ubuntu" --configdir="%APPDATA%\wsltty" -. Like the other examples, these all hang:

    Ubuntu Terminal

30-60 minutes later:

  1. Roughly 30-60 minutes into writing this post, the bottom Ubuntu window you see in point 3 closed on its own. Now the top Ubuntu window says it's installing, the cmd.exe's wsl.exe command errored out, but the powershell window remains unresponsive:

    enter image description here

    enter image description here

  2. About 10 minutes later, the powershell's wsl.exe command errored out too:

    enter image description here

    I think this delay is due to running the powershell command roughly ten minutes after the cmd.exe command.

  3. About five minutes later, the Ubuntu window closed on its own.

  4. The vmmem.exe process is still not running, which concerns me, but I haven't retried anything yet.

  5. The Microsoft store says that I'm using this version of Ubuntu. Unfortunately, as I mentioned in point 10, I don't know if this is any different from before the install occurred.

    enter image description here

  6. Unfortunately, when I try to do anything with WSL, I still have all the same symptoms I described at the beginning.

  7. I'm going to restart now but if that fixes it, that'll limit my ability to provide information until it happens again. I've exported a list of running services to a file in case it helps to see what was active during this issue.

System Information:

  1. I installed (and upgraded) WSL2 months ago and use it almost daily.

  2. When I go into the task manager, I notice the vmmem.exe process is not running. That feels important, but I don't know how to start it; I can only find people asking how to stop or restart it, and those answers all use wsl.exe. As you can see in the Symptoms section, I can't use that command right now.

  3. According to the task manager, my CPU usage is around 0-5%. When I sort by usage, descending, I don't see anything WSL2 related in the top ten.

  4. According to the task manager, my Memory usage is around 50%. When I sort by usage, descending, I don't see anything WSL2 related in the top ten.

  5. Windows update says I'm up to date (I checked while writing this):

    enter image description here

  6. There was one optional update available, but for some reason, whenever I install this, my system can no longer connect to the Internet.

    enter image description here

  7. I've installed Ubuntu from the Windows Store, and I'm interpreting from the UI, that it doesn't need an update:

    enter image description here

    I wish I could find exactly what version is installed, but I'm not sure how to find that in this UI.

    Update: Now I see you need to scroll past most of the content to find this information. Unfortunately I only noticed this after step 12, so I'm not sure what version I had at the time of writing this bullet point.

  8. Although Ubuntu is installed from the Windows Store, WSL2 is not. Apparently I downloaded and installed it manually. According to my "Apps & features" settings, I'm running this version:

    enter image description here

    If wsl.exe says a different version, I'll come back and edit this line. At the moment, I'm unable to provide that information because the only way I know how is to run wsl.exe, and wsl.exe currently hangs.

8
  • 3
    Uninstall everything then reinstall WSL from the Microsoft Store and after that is installed should you install WSL distribution
    – Ramhound
    Commented Jan 13 at 7:40
  • I'm sure this is TMI as it is, but I was able to resolve this. The details of my journey are documented here: github.com/microsoft/WSL/issues/11067#issuecomment-1911527056 TL;DR: reinstall WSL, toggle the win10 feature named Hyper-V, and avoid running wsl --upgrade. I've yet to confirm which of those last two are necessary, but I'm pretty confident at least 1 is. Commented Jan 29 at 20:05
  • Hyper-V isn’t required for WSL.
    – Ramhound
    Commented Jan 29 at 20:42
  • @Ramhound Hm. Is the faq out of date? Maybe what it means is "Virtual Machine Platform" sets up its own Hyper-V so I don't need to check the box? Commented Jan 29 at 22:17
  • 1
    "toggle the win10 feature named Hyper-V" - This could be taken two days. If it's enabled you disable Hyper-V, likewise, it could also mean if it's disabled you enable it. My comment was to indicate that Hyper-V is not required for WSL to be functional.
    – Ramhound
    Commented Jan 29 at 23:15

2 Answers 2

2

not sure if this will help you. if the system hangs, kill the processes. wsl, wslservice, and wslhost. pslist and pskill from sysinternal works great. one of them will require elevated account to kill, but once dead, i do a wsl --shutdown and then restart wsl and seems to be fine.

2
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented May 27 at 6:43
  • Next time this occurs, I will try it and see if it works. Thanks Commented Jun 1 at 21:32
0

I ran into this issue some time ago. I reinstalled the distribution, but the issue came back. The final solution might be to reinstall WSL completely. However, if that is not something you want to do, you can try restarting the service "LxssManager" the WSL hanging issue is linked to that service been stuck in a stopping state. Thus, you would need to force it to stop by killing its process; in order to find the process for the service you can run the following command

tasklist /svc /fi "imagename eq svchost.exe" | findstr LxssManager

After killing that process WSL should actually start without hanging.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .