WSL: WSL don't start, don't open and don't answer

Environment

Windows build number: 20197.1000 WSL 2

Steps to reproduce

Open the Windows terminal

Expected behavior

Should open the Ubuntu terminal but didn’t appear even the tab in the Windows terminal.

Actual behavior

The problem is that sometimes, when I open the Windows Terminal the WSL don’t appear. Acctually appear once but don’t show/load anything, then, when I open again the terminal, it’s gone. If I try to run wsl or wsl -l -v or wsl --shutdown, nothing happens, just keep like it’s loading the answer forever. If I try to open the Linux folder just keep loading forever. Sometimes I restart the computer and just works but sometimes don’t. I tried reinstall all Linux but the error appear again.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 201
  • Comments: 242 (2 by maintainers)

Most upvoted comments

I followed this setup https://github.com/lewagon/setup/blob/master/WINDOWS.md I am able to open the Ubuntu icon from Start Menu and wsl too. When I open, an terminal show up all black and nothing happens. If I try to run any command like wsl.exe or wsl -l -v, etc, nothing happens either, just keeps like it’s waiting for an answer

Disabling and then re-enabling HyperV feature followed by a restart worked for me to revive My WSL2

I had same issue. Turning off Hyper-V in Windows Features resolved the issue for me, but then I have trouble with Docker Desktop.

Since Windows [10.0.20201.1000] wsl doesn’t work (neither Docker for Windows)

basicaly… when we enter wsl : nothing happen… it won’t respond.

I try this (also… lot of reboot)

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

wsl --set-default-version 2

wsl.exe --update

wsl --shutdown

wsl -l -v

PS C:\WINDOWS\system32> wsl -l -v NAME STATE VERSION

  • Ubuntu-20.04 Stopped 2 Ubuntu-18.04 Stopped 2 docker-desktop-data Stopped 2 Ubuntu Stopped 2

no problem so far… but if I try just to enter wsl… it will stalled

I try wsl -d Ubuntu … same thing.

Same issue. When I try to stop it with sc as an administrator I get this:

C:\WINDOWS\system32>sc query LxssManager

SERVICE_NAME: LxssManager
        TYPE               : 30  WIN32
        STATE              : 3  STOP_PENDING
                                (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x2
        WAIT_HINT          : 0xea60

C:\WINDOWS\system32>sc stop LxssManager
[SC] ControlService FAILED 1061:

The service cannot accept control messages at this time.

Only way to fix this is a complete reboot.

Did you install a WSL distro from the Store? Can you run it from the icon on the Start Menu?

I know this isn’t a solution for WT but I am trying to determine if it is properly installed.

In PowerShell, what does the following report?

wsl.exe --list --all --verbose

Do you have any third-party security or endpoint management utilities installed on this device?

I had this issue exactly as described by @isaporto on my Windows 11. I did the followings and it solved the problem:

Press Windows key + R Type: optionalfeatures.exe Hit Enter

Scroll to the bottom

Uncheck Windows Subsystem for Linux Click OK

Restart if prompted

Press Windows key + R Type: optionalfeatures.exe Hit Enter

Scroll to the bottom

Check Windows Subsystem for Linux Click OK

Restart if prompted

I found this solution on the following page: https://answers.microsoft.com/en-us/windows/forum/all/error-server-execution-failed-when-trying-to-run/1e834b62-8106-4fc3-8bbf-9ab1b1218388

I’ve had a similar issue. Found this fix somewhere and wanted to share:

  • Search for “features” in Windows
  • Open up “Turn Windows features on or off”
  • Look for the WSL feature
  • Disable the feature and reboot
  • Enabled it again and reboot

features

May be a temporary fix but it’s working for now (I’ve just noticed there are other versions of this same fix in this very thread, may wanna go with those)

Had a similar issue where one day I could open my Ubuntu terminal and the next day it stopped working. Would not be able to access my files and opening Ubuntu gives me a blank terminal with nothing on it (no words etc).

I tried uninstalling and reinstalling Ubuntu and it did not work. Tried restarting my computer, nothing happened.

What worked was this:

  1. Go to ‘Programs and Features’
  2. Click ‘Turn Windows features on or off’
  3. Check if ‘Windows Hypervisor Platform’ is enabled (I also enabled ‘Virtual Machine Platform’)

Afterwards it worked again, hope this manages to help someone!

I’m also having this problem. With a few particularities:

  1. All WSL commands from PowerShell as Admin hangs. Including --help.
  2. After a while waiting wsl --help it answers me with Failure on server execution
  3. I’m using a Debian distro from Store, and the only things installed are NPM and PHP to Laravel development with VueJS.
  4. Everything works fine after a reboot, and kill Lxss by Task Manager, Service Manager, SC or any other things don’t work.
  5. When this happens, every single WSL distro also hangs, and Windows Terminal can’t find GUID of my distros.
  6. I realized that every time my distro hangs was after development with commands like artisan serve and npm run watch-poll.

In other reports that I read it seems to be something with NTFS and NPM watcher, but still not sure about it.

For now, I’m using Insider 20H2, build 19042.

I’m experiencing the same behavior on W10 20H2:

  • Every wsl command hangs
  • No way to kill lxss except reboot
  • This happen almost everytime when I switch from ‘Hyper-V off’ to ‘Hyper-V on’ (have to disable Hyper-V from time to time as I sometimes need VirtualBox)

for me disabling wsl and reenabling solved the issue image

This is helped me:

PS C:\WINDOWS\system32> wslconfig /L docker-desktop-data (default) Ubuntu-18.04 docker-desktop

The default system for wsl was docker-desktop-data. Then I changed it on Ubuntu-18.04 via wslconfig /s Ubuntu-18.04

Yes same problems, and I found few posts that others persons have the same issues.

It just happened for me for the first time in 2 years, and restarting LxssManager process fixed the issue

That was the solution for me, with these steps.

when you hit the issue, can you check the disk usage? I do found that if there is very few free disk space available(eg. 1G), the lxss has slow response or no response. Another factor is the memory, lxss has very slow response if memory is 1G. It requires 2G or more for Windows 10. If you run windows 10 in virtual machine, please make sure you allocated 2+G memory.

I had this issue exactly as described by @isaporto on my Windows 11. I did the followings and it solved the problem:

Press Windows key + R Type: optionalfeatures.exe Hit Enter

Scroll to the bottom

Uncheck Windows Subsystem for Linux Click OK

Restart if prompted

Press Windows key + R Type: optionalfeatures.exe Hit Enter

Scroll to the bottom

Check Windows Subsystem for Linux Click OK

Restart if prompted

I found this solution on the following page: https://answers.microsoft.com/en-us/windows/forum/all/error-server-execution-failed-when-trying-to-run/1e834b62-8106-4fc3-8bbf-9ab1b1218388

Thank you so much, you saved my life! @arminms

thanks that worked for me as well. I had to get the process id using sc queryex LxssManager and then had to use Process Hacker to restart the service svchost.exe which had the same pid because CMD or Powershell denied me the access even with admin rights

Hi My WSL does not show any feedback, neither in the terminal, nor in PowerShell, nor in File Explorer.

wsl

If it is, disabling swap and trying to launch would confirm:

.wslconfig [wsl2] swap=0

I also encounter this phenomenon almost 50% of the time every time I start Windows. Previously, this was handled by restarting the OS, but we have found that it can be handled by simply restarting wslservice.

This is not a solution to the root cause and will probably recur, but we will see how it goes for now.

I will note the command so that I can reproduce it in case it is useful to someone else. Run with administrator privileges. lxssmanager will also be restarted just to be sure.

sc stop wslservice
sc stop lxssmanager
sc start lxssmanager
sc start wslservice

For me, restarting the WslService fixed it, I’m on Windows 11 22H2

for me, restarting LxssManager service fixed it

for me disabling wsl and reenabling solved the issue image

Thank you it works

edit: But this solution destroyed my linux vm on vmware

I had this problem either and solved it by setting a default distribution - since no one was set.

Find your preferred distro name using wsl --list and set it as default with wsl --setdefault <DistributionName>.

There are two suspicious:

  1. missing kernel. please run wsl --update --status to see if there is any error.
  2. the swap file. you can create .wslconfig in %userprofile% to verify it. A reboot is required to apply it if your machine is already in weird state.
.wslconfig
[wsl2]
swap=0

Had a similar issue where one day I could open my Ubuntu terminal and the next day it stopped working. Would not be able to access my files and opening Ubuntu gives me a blank terminal with nothing on it (no words etc).

I tried uninstalling and reinstalling Ubuntu and it did not work. Tried restarting my computer, nothing happened.

What worked was this:

1. Go to 'Programs and Features'

2. Click 'Turn Windows features on or off'

3. Check if 'Windows Hypervisor Platform' is enabled (I also enabled 'Virtual Machine Platform')

Afterwards it worked again, hope this manages to help someone!

This worked for me, enabled Windows Hypervisor Platform and restarted, all good afterwards, back on track!

I don’t understand why, but I managed to fix this by running the following in Powershell in administrative mode.

netsh int ip reset all
netsh winsock reset

I don’t even have to restart; WSL starts working the second I run these commands.

for me going to the task mannager and ending the task of the wsl or windows subsystem for linux and opening it again worked for me

i reanimated wsl with these commands using as admin powershell: net stop LxssManager net start LxssManager

Try run cmd as admin and execute netsh winsock reset. Then reboot. It works or me! @yangliu

In my case my laptop shutdown unexpectedly the night before and seemed to have left the LxssManager in a blocked state preventing wsl.exe from working and Docker Desktop from starting up. Restarting the service resolved the issue immediately.

  1. Open Microsoft Services
  2. Search for LxssManager
  3. Hit restart

After I created the .wslconfig file I reboot the computer. Still not working! https://aka.ms/AA9j1mx <- I tried to reproduce the error, but basically the windows terminal don’t load the ubuntu. any command like wsl --shutdown or wsl -l -v don’t work but don’t print any message error too, just keeps loading forever. I will try to update my windows to Windows [10.0.20201.1000] but seems that another persons get the same error with this version too

If anyone is still having this issue, for me the issue was with my .bashrc file. Fixed it by entering as root: wsl -u root and then copying /etc/skel/.bashrc to my user’s home directory. Exiting and opening wsl worked for me after this.

It just happened for me for the first time in 2 years, and restarting LxssManager process fixed the issue

I’m also having this problem. With a few particularities:

  1. All WSL commands from PowerShell as Admin hangs. Including --help.
  2. After a while waiting wsl --help it answers me with Failure on server execution
  3. I’m using a Debian distro from Store, and the only things installed are NPM and PHP to Laravel development with VueJS.
  4. Everything works fine after a reboot, and kill Lxss by Task Manager, Service Manager, SC or any other things don’t work.
  5. When this happens, every single WSL distro also hangs, and Windows Terminal can’t find GUID of my distros.
  6. I realized that every time my distro hangs was after development with commands like artisan serve and npm run watch-poll.

In other reports that I read it seems to be something with NTFS and NPM watcher, but still not sure about it.

For now, I’m using Insider 20H2, build 19042.

Hello, i’ve had the same problem. wsl command unresponsive, waiting forever but no output.

Seems resolved now. Here the steps i followed:

  • windows features -> remove hyper-v -> reboot

After apply & reboot, wsl started working again.

As per this link I’ve applied the minimal wsl configuration, so from windows features I’ve enabled “Hyper-V > Hyper-V Platform > Hyper-V Services” and “Windows Hypervisor Platform” (this one I can’t tell if was enabled before disabling hyper-v but was off now). “Virtual Machine Platform” was already enabled for me.

After apply & reboot, wsl is still working fine.

Disabling and then re-enabling HyperV feature followed by a restart worked for me to revive My WSL2

This worked for me.

Running wsl.exe --update fixed it for me

I had the same problem today. Rebooting didn’t work. I couldn’t find the LxssManager service either. What worked was opening the task manager -> details -> trying to stop all tasks (even if some of them didn’t stop immediately) containing the wsl word. I’m not sure, but I think specifically stopping the wslservice.exe task did the job.

Windows: Win 11 22H2 (22621.819) Ubuntu: Ubuntu 22.04.1 LTS Linux kernel: 5.15.74.2-microsoft-standard-WSL2

for me disabling wsl and reenabling solved the issue image

Same here. Turned it off, restarted the computer, turned it on, restarted the computer and the problem was gone.

This fixed things for me in my “latest” WSL2 setup - specifically, somehow the features for “Virtual Machine Platform” was deactivated.

for me disabling wsl and reenabling solved the issue image

Same here. Turned it off, restarted the computer, turned it on, restarted the computer and the problem was gone.

I wasn’t able to get it working again at all. I didn’t install the feature update tho as I figured, its just a feature update I don’t need. Deleted windows and using native Ubuntu ATM. Just sick opf windows doing crap like this to me out of nowhere and costing precious time in the middle of serious fixes for my work. When did windows become so dam unreliable? Are they doing this on purpose to make us go to win11?

It fail on Win11 too… so…

And course, after applying the latest “Cumulative Update Preview” (KB5006738) and yet another restart, the issue has disappeared. Fun 😦, but at least it is working again. It may have been networking related as well, as I rebooted my router as well (although this ‘should’ be a purely local thing). Unfortunately, not able to troubleshoot now since it’s magically resolved.

Looks like updating WSL worked out for me.

wsl --update

image

I’m using windows 11… and the problem continues, and is updated. The only way to fix it is a full windows restart

Looks like updating WSL worked out for me.

wsl --update

Got it working by doing the following.

Control Panel => Programs & Features => Click on Turn Windows Features On/Off => Turn Off Windows subsystem for linux => (Turn it on again) => Click on Restart Now

This should do it.

I have the same problem. Only a reboot fix it.

Same issue here, I followed #849 (comment) solution but I hope this is only temporal…

A three year old fix still seems to work, it fixed it for me as well. Can we please fix this permanently, I depend heavily on WSL now.

Same issue. It worked until the last update arrived KB4571744

I had the same problem.

“If I try to run wsl or wsl -l -v or wsl --shutdown, nothing happens, just keep like it’s loading the answer forever.”

As a last resort, you can force exit and rerun.

https://github.com/uzchss22/TerminateWSLService.git

  1. Download zip file
  2. Decompression
  3. Run the .bat file (if you are security sensitive, you can check the source code of GitHub.)

I just ended the WSL tasks from Task Manager and re-opened it. This worked for me.

For me the solution was to enable Control Flow Guard (CFG). I needed to disable this in Windows Security settings to run some games, never couldn’t guess that this will make Docker and WSL stop working

Could this be related to an SD Card? Today I had this experience:

  1. using vscode with WSL extension, everything fine
  2. plugged in an SDcard (from a Dashcam), and used it in Windows (uploaded 2 mp4 files to photos.google.com, not using WSL at all)
  3. back to vscode, its terminal is frozen!
  4. reboot the laptop, vscode won’t start because it cannot access wsl filesystem or shell.
  5. windows Start, cmd, wsl --list --all does not respond
  6. LxssManager service is running fine
  7. repeat the above three several times, same result
  8. remove sdcard, no reboot
  9. vscode works fine, wsl --list --all works fine

Hardware: Dell xps 17 9710, 64 GB, ssd 1TB, (578F for wsl2 of which 248G used), Windows 11 Pro 21H2 build 22000.1641, hyper-v on.

Anyone else had the above experience? Try it out? Repeatable?

For me it was memory issue, even though i had 11GB free storage, out of 500GB, i cleared it up to 25GB and now its working again.

My WSL stopped working on Window 10, after I accidentally closed the terminal during Ubuntu upgrade from 1 to 2. All of the wsl commands also stopped working. This helped me. Go to Settings > Apps & Features > Search for Ubuntu > Click on it > Advance Options > Reset

image

Ubuntu started working as expected. I have to reconfigure the environment there again after this.

I’m having a similar issue. The commands wsl and wsl -l hang indefinitely, although wsl --help outputs the help string. If I open the Debian terminal, it also hangs without printing anything.

I’m on Windows 11, in the Beta insider program, build number 22622.590 ni_release.

I’ve tried:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
wsl.exe --update
wsl --shutdown
wsl -l -v
wsl -d Debian

Edit:

When I logged in with a different user on the same computer after doing all of the above, wsl worked perfectly. I’m assuming the problem was specifically some config file in my AppData folder, but I’m not certain.

I ended up reinstalling Windows, and I did not rejoin the Beta insider program and WSL works now. I’ve edited the list above, for others running into the same problem.

Uninstall / reinstall WSL2 solved the problem (Windows 10 Pro 21H2 + Windows Feature Experience Pack 120.2212.4170.0). The new “When in doubt: reboot, if it fails, re-install” ?

Same – a reboot fixed it for a session – but then it just happened again the next day – so I did a full reinstall of hyper-v, wsl2, the distro (everything, basically) – and that fixed it for me. 🤷🏻‍♂️

I feel like this behavior is indicative of a bug that needs to be fixed – but how to reproduce it? … I’m not sure… and honestly… I don’t want to find out! 😅

Experiencing the same issue, but I’m on Windows 11.

Uninstall / reinstall WSL2 solved the problem (Windows 10 Pro 21H2 + Windows Feature Experience Pack 120.2212.4170.0).

The new “When in doubt: reboot, if it fails, re-install” ?

Same – a reboot fixed it for a session – but then it just happened again the next day – so I did a full reinstall of hyper-v, wsl2, the distro (everything, basically) – and that fixed it for me. 🤷🏻‍♂️

I feel like this behavior is indicative of a bug that needs to be fixed – but how to reproduce it? … I’m not sure… and honestly… I don’t want to find out! 😅

I had this issue exactly as described by @isaporto on my Windows 11. I did the followings and it solved the problem:

Press Windows key + R Type: optionalfeatures.exe Hit Enter

Scroll to the bottom

Uncheck Windows Subsystem for Linux Click OK

Restart if prompted

Press Windows key + R Type: optionalfeatures.exe Hit Enter

Scroll to the bottom

Check Windows Subsystem for Linux Click OK

Restart if prompted

I found this solution on the following page: https://answers.microsoft.com/en-us/windows/forum/all/error-server-execution-failed-when-trying-to-run/1e834b62-8106-4fc3-8bbf-9ab1b1218388

It works for me. Thanks a lot.

Had the same issue from one day to the other, without installing something or doing something special other than running Vscode.

Deinstalling Hyper-V fixed it for me:

Press Windows key + R Type: optionalfeatures.exe Hit Enter

Scroll to the Hyper-V

Uncheck Hyper-V Click OK

Restart

  • Search for “features” in Windows
  • Open up “Turn Windows features on or off”
  • Look for the WSL feature
  • Disable the feature and reboot
  • Enabled it again and reboot

This helped! Thanks @n8eloy

I had this problem either and solved it by setting a default distribution - since no one was set.

Find your preferred distro name using wsl --list and set it as default with wsl --setdefault <DistributionName>.

It does not work for me

This worked for me. Thanks a lot.

It does not work for me. The problem continues

Same issue here, I followed https://github.com/microsoft/WSL/issues/849#issuecomment-322163360 solution but I hope this is only temporal…

@isaporto regarding lxss, usually it means the LxssManager.

Somethings you can try:

  1. If you’re not already, use powershell instead of cmd.exe. while not really related to your problem, it’s just nicer.
  2. restart LxssManager :
7-preview $ Get-Service | grep Lxss
Running  LxssManager        LxssManager
Stopped  LxssManagerUser_9â?▌ LxssManagerUser_9eb01
7-preview $ stop-service LxssManager
7-preview $ start-service LxssManager

or you can use the TaskManager:

2020-10-24_11-19-47

I don’t understand why, but I managed to fix this by running the following in Powershell in administrative mode. netsh int ip reset all netsh winsock reset

This one worked for me as well though not sure how this is related to wsl.

I’m using Windows 11 Enterprise, OS build 22621.1992. WSL2 stopped working after a reboot, The solution is to restart “LxssManager”. Steps: type “services” in the search bar at the bottom taskbar, find “LxssManager”, right-click, restart, and that’s it.

To me didn’t worked but because the System said it wasn’t possible to stop it in a fashion amount of time. Maybe because I had the IDE still opened. I’ll try again later. But still, is there a way to obtain a clean log about the why the service freeze?

I’m using Windows 11 Enterprise, OS build 22621.1992. WSL2 stopped working after a reboot, The solution is to restart “LxssManager”. Steps: type “services” in the search bar at the bottom taskbar, find “LxssManager”, right-click, restart, and that’s it.

for me it also worked to end the task and open it again

Could this be related to an SD Card? Today I had this experience:

  1. using vscode with WSL extension, everything fine
  2. plugged in an SDcard (from a Dashcam), and used it in Windows (uploaded 2 mp4 files to photos.google.com, not using WSL at all)
  3. back to vscode, its terminal is frozen!
  4. reboot the laptop, vscode won’t start because it cannot access wsl filesystem or shell.
  5. windows Start, cmd, wsl --list --all does not respond
  6. LxssManager service is running fine
  7. repeat the above three several times, same result
  8. remove sdcard, no reboot
  9. vscode works fine, wsl --list --all works fine

Hardware: Dell xps 17 9710, 64 GB, ssd 1TB, (578F for wsl2 of which 248G used), Windows 11 Pro 21H2 build 22000.1641, hyper-v on.

Anyone else had the above experience? Try it out? Repeatable?

Thank you for posting this @benreaves! I totally forgot I had plugged in an sdcard. The moment I ejected it, my terminal populated and Docker started working again!

Similar to others, restarting my computer made the trick for me. I was shutting down the computer and then booting it, and that didn’t work. You really need to choose the “restart” option.

For me, restarting the WslService fixed it, I’m on Windows 11 22H2

This works for me as well! 🎉

But, before restart WslService, I had to stop “Docker Desktop Service” process in Processes lists on Task Manager.

I’m also using Windows 11 Pro 22H2

Hi, I had a similar problem, not only with WSL but also with Docker. It was solved by updating Powershell to version 7.2

Guide: If the terminal for wsl stops starting or Docker doesn’t start and gives a “Starting” status.

Check the version of Powershell. To do this, open the Powershell terminal and type the command “$PSVersionTable” and if the version is lower than 7.2, you need to update Powershell. Go to the Microsoft documentation site, Powershell Update - Powershell Docs. After installing the new version of Powershell, reboot your computer. Docker now works! 😃

Uninstall / reinstall WSL2 solved the problem (Windows 10 Pro 21H2 + Windows Feature Experience Pack 120.2212.4170.0).

The new “When in doubt: reboot, if it fails, re-install” ?

In PowerShell, what does the following report?

wsl.exe --list --all --verbose

Same with any WSL command – it just hangs for me.

In my case, LxssManager Windows service was stuck. Just rebooted.

Environment

Windows build number: 20197.1000 WSL 2

Steps to reproduce

Open the Windows terminal

Expected behavior

Should open the Ubuntu terminal but didn’t appear even the tab in the Windows terminal.

Actual behavior

The problem is that sometimes, when I open the Windows Terminal the WSL don’t appear. Acctually appear once but don’t show/load anything, then, when I open again the terminal, it’s gone. If I try to run wsl or wsl -l -v or wsl --shutdown, nothing happens, just keep like it’s loading the answer forever. If I try to open the Linux folder just keep loading forever. Sometimes I restart the computer and just works but sometimes don’t. I tried reinstall all Linux but the error appear again.

I had the similar issue. When I reload cmake project in clion(using wsl to debug code), nothing happened but heavily stuck. If I close clion in task manager at this time, something like this issue happend. It never happend before I reinstall windows 11.

For me, turning on NFS services in windows feature solved this problem.

Hi, in my case McAfee Endpoint Security was blocking Microsoft WSL (Windows Subsystem for Linux) as described here: Microsoft WSL (Windows Subsystem for Linux) is not working with ENS 10.7.x

Symptoms

  • Docker wouldn’t start issuing the following error:

    System.InvalidOperationException:
    Failed to deploy distro docker-desktop to %USERPROFILE%\AppData\Local\Docker\wsl\distro: exit code: -1073740791
    
    For full output, click to expand!
    System.InvalidOperationException:
    Failed to deploy distro docker-desktop to %USERPROFILE%\AppData\Local\Docker\wsl\distro: exit code: -1073740791
     stdout: 
     stderr: 
       at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR-17296\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 146
       at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__17.MoveNext() in C:\workspaces\PR-17296\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 168
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() in C:\workspaces\PR-17296\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 77
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__28.MoveNext() in C:\workspaces\PR-17296\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 178
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\PR-17296\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-17296\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-17296\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92
    
  • As described wsl commands will “execute” without any response. E.g.:

    PS C:\WINDOWS\system32> wsl.exe --list --all --verbose
    PS C:\WINDOWS\system32> wsl --list --all --verbose
    PS C:\WINDOWS\system32> wsl --help
    PS C:\WINDOWS\system32>
    
  • In McAfee’s Event Log you should find entries like these:

    <USERID> ran C:\Windows\System32\wsl.exe, which attempted to access the process LxssManagerProxyStub.dll, violating the rule "Executing Windows Subsystem for Linux", and was blocked. For information about how to respond to this event, see KB85494.
    

Fix

I implemented basically the fix described in the same McAfee thread (slightly modified). DO SO AT YOUR OWN RISK: That is, open McAfee Endpoint Security, go into Threat Prevention, click Show Advanced (top right), navigate to Access Protection, and in the Rules list, uncheck Block at Executing Windows Subsystem for Linux.

image

Thanks, its works for my @arminms

I had same issue. Turning off Hyper-V in Windows Features resolved the issue for me, but then I have trouble with Docker Desktop.

work for me ! thinks

Solved it for myself. VMWare issue. Some weird problem with bugged VMWare Workstation uninstall. After uninstalling VMWare Bridge Protocol from all network adapters my WSL problem was finally solved. I’m so happy about it 😄

@francogp Two points:

  1. I’m specifically interested in those of us who have experienced this issue and whether there is a common environmental factor (e.g. network change) that is triggering it. My question is therefore germane to this bug and not to a general discussion or thread.
  2. If there isn’t going to be any effort to do anything useful with the info provided in this issue, it should be closed and users requested to file a new (and separate) issue. Otherwise this ‘issue’ is just a complaints department.

A question for those still on the thread: Aside from WSL2 and a wired interface, do you use other network interfaces? If you also have wireless, do you switch between a wired and wireless connection?

I’m suspecting the WSL2 networking is getting ‘bunged up’ on certain network transitions.

This has happened twice for me so far on Windows 11.

I turned off “Windows Subsystem for Linux” from Windows Features, rebooted, then turned it back on again and then rebooted again. This fixed the issue, and thankfully my Ubuntu distro (installed from Store) and files in it were intact.

I’m on Windows 11 build 22000.318 right now (this happened just now and was fixed by the method I described), and it had happened once before too but I’m not sure about the exact build number back then.

So why exactly it is still a problem in 21H2 22000.282? Kernel version: 5.10.60.1 LxssManager is running, the fullest disk drive has >400G free, all disks @ 0% utilization, CPU < 5%, memory < 20%, this is happening right after a cold start.

A simple OS restart fixes the issue, but why would this happen in the first place?

Same issue today.

#849 (comment) has a solution

Seems to have fixed it (for now). Commenting so you can know it’s effecting more people.

Edit: It was only temporary. Broken again.

I ran into this problem today too, just after doing this kind of work, but with Jekyll serve

followed this entire thread + #849 :

  • found 0 real and non hacker-y solutions to this problem

As anyone would do (I guess) I tried:

  • Check for Windows updates: None
  • Reboot the computer: Nothing

My solution (even if not so technical)

  • I went in settings.json and:

    1. Changed the defaultProfile to a standard one
    2. Deleted the WSL profile
  • I uninstalled the WSL completly

  • Rebooted the computer

  • Reinstalled the WSL from the Microsoft Store

Important

  • Remember to make a backup copy of your settings.json profile if you personalised it.
  • After the fresh installation, run this command in an Administrator PowerShell, as Microsoft says -> click More : Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  • Launch

You can also try out this newer guide from the official Microsoft Documentation.

However, this is not a reliable solution if you had important configurations inside WSL itself, as a reinstall will erase everything. What can you do in this case? Well, before proceeding with the reinstallation, follow this thread.

Edit: This problem seems to happen when the WSL is corrupted, moved, uninstalled or if the settings.json file defaultProfile doesn’t match any profile. One more thing that is worth trying is this: Image 1 Image 2

oh ! I got a Green screen of death again… after that I did a hard reboot (press poweroff for few seconds)

Windows rebooted and I got a welcome screen and enter few settings like (my default browser, finger…) rebooted again… and now wsl + docker works.

but I previously I added

.wslconfig [wsl2] swap=0

and rebooted, but wsl didn’t work at that time