ubuntuwindows-subsystem-for-linux

Can't restart WSL2, LxssManager hangs in stopping state, how to restart?


I Can't restart wsl2, the command wsl --shutdown and any other wsl command hangs forever. Also I found the service LxssManager in stopping status also hangs forever.

How can I restart wsl ?


Solution

  • It looks like the hang LxssManager service is preventing wsl to restart, I found a way to stop LxssManager and then I was able to restart wsl normally.

    First get the PID of svchost.exe running LxssManager, open the cmd as administrator and run:

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

    Grab the returned PID, then run task manager as administrator, in the details tab, search for the svchost.exe containing the PID, right click it and select 'end process tree'.

    Now you should be able to restart wsl normally with 'wsl shutdown and wsl.