Question

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 ?

 48  43646  48
1 Jan 1970

Solution

 144

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.

2022-01-03

Solution

 144

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.

2022-01-03

Solution

 3

I was in the same situation and restarting LxssManager service solved my problem.

Start a command prompt with administrative rights (I am logged with a normal user) and copy and paste in order to run the following commands:

sc.exe queryex LxssManager
sc.exe stop LxssManager
sc.exe start LxssManager
sc.exe queryex LxssManager

P.S. If after the second queryex command LxssManager PID is not different then stop did not succeed and you should try to run the commands after switching user to an administrative one.

P.P.S. If you still cannot stop the service, you should use Task Manager to "End process tree" in Details tab (using the PID displayed by queryex command). Make sure you are signed in (is more powerfull than 'run as') as an administrative user.

2022-10-26

Solution

 3

I was in the same situation and restarting LxssManager service solved my problem.

Start a command prompt with administrative rights (I am logged with a normal user) and copy and paste in order to run the following commands:

sc.exe queryex LxssManager
sc.exe stop LxssManager
sc.exe start LxssManager
sc.exe queryex LxssManager

P.S. If after the second queryex command LxssManager PID is not different then stop did not succeed and you should try to run the commands after switching user to an administrative one.

P.P.S. If you still cannot stop the service, you should use Task Manager to "End process tree" in Details tab (using the PID displayed by queryex command). Make sure you are signed in (is more powerfull than 'run as') as an administrative user.

2022-10-26