WSL icon indicating copy to clipboard operation
WSL copied to clipboard

all wsl.exe commands hang

Open devsnek opened this issue 7 years ago • 75 comments

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.18917.1000]

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)

$ wsl.exe --help $ wsl.exe -d Debian etc...

Example with --help passed (screenshot taken 30s after running command)

  • What's wrong / what should be happening instead:

wsl.exe should not hang.

devsnek avatar Jun 15 '19 01:06 devsnek

Run wsl.exe --shutdown on an elevated cmd to make sure there is no VM running that can slowdown everything.

Things to try: -what it shows on cmd when you type where wsl ? -on powershell does wsl --help hangs too? -show the output of wsl -l -v and wsl echo "Hello". Did they hang too?

onomatopellan avatar Jun 15 '19 14:06 onomatopellan

@onomatopellan everything you suggest also hangs

devsnek avatar Jun 15 '19 15:06 devsnek

restarting fixed this, but obviously i don't know if it will happen again...

devsnek avatar Jun 15 '19 15:06 devsnek

I'm running 18917 inside a Hyper-V VM and it didn't happen to me yet.

Next time you can try Process Explorer to see what's happening during the hangs.

onomatopellan avatar Jun 15 '19 15:06 onomatopellan

Seems related to issue #4047.

craigloewen-msft avatar Jun 17 '19 18:06 craigloewen-msft

It occasionally happens on my PC running 10.0.17763.740.

kamil-mrzyglod avatar Oct 04 '19 09:10 kamil-mrzyglod

Seeing this with 10.0.19013.1.

rlipscombe avatar Nov 05 '19 10:11 rlipscombe

Observed 10.0.19041.388.

  • No response to any command. Just hangs
  • where wsl gives nothing

arsdever avatar Aug 16 '20 18:08 arsdever

Also facing this issue recently. I also tried restarting my laptop, but still, the issue persists.

Windows: Version 10.0.19041.450 wsl echo "test": Hangs, non-interruptible (Ctrl + C) wsl --help: Does not hang wsl -l -v: Hangs, interruptible wsl --shutdown: Hangs, interruptible

kdbcinco avatar Aug 31 '20 10:08 kdbcinco

Also experiencing this with 10.0.18363.1049

kthompson avatar Sep 03 '20 20:09 kthompson

I'm also running into this problem on 10.0.20211.1000, restarting the host machine (maybe a couple of times) usually does the trick.

8549 avatar Sep 15 '20 09:09 8549

Started happening recently, all wsl.exe related commands hang except for wsl --help. OS version: 1909 OS build: 18363.1082

emilsrits avatar Sep 28 '20 09:09 emilsrits

same issue, except wsl --help is hanging as well

[Version 10.0.19041.572] if that helps

edit: double restart fixed it for now

aadibajpai avatar Oct 20 '20 13:10 aadibajpai

I had this problem too. Trying to install an image would get stuck in the Installing state, or converting an image from WSL1 would report the error "the operation could not be started because a required feature is not installed."

The suggestion of disabling the override of Control Flow Guard in this comment solved the problem: https://github.com/microsoft/WSL/issues/4626#issuecomment-553416411

nickb937 avatar Nov 11 '20 09:11 nickb937

same issue, all wsl commands (including wsl --help) hang OS version: 1909 OS build: 18363.1198

taseikyo avatar Nov 13 '20 08:11 taseikyo

same issue, all wsl commands (including wsl --help) hang for a long time and then return with:

PS C:\WINDOWS\system32> wsl --help
Server execution failed
PS C:\WINDOWS\system32>

Which looks like this same issue described on superuser

OS: Windows 10 OS version: 2004 OS build: 19041.572

No updates to Windows in past eight days, yet this issue begins out of the blue...

jsteenri avatar Nov 18 '20 04:11 jsteenri

Update: Disabling Hyper-V seems to have solved my issue. Or rebooting six or eight times; I guess I won't ever know.

Details ServerFault issue mentioned disabling and re-enabling WSL, but I started by first using 'optionalfeatures.exe' from Command Prompt as described there, yet only unchecking entire "Hyper-V" section and rebooting per this list of suggestions

Results Now, WSL2 distro is working, all files intact, and Docker Desktop (using WSL2 backend) is also happy. Note, Hyper-V had been enabled, though largely unused, for all of 2020, while WSL2 usage has only been since August. So maybe Hyper-V and WSL don't play nice together, or something from a recent update bungled that?

Theory Something with Hyper-V (and maybe a recent update) was causing the LxssManager service to be dead upon Windows startup and completely unresponsive to any changes. With Hyper-V now out-of-the-way, Lxssmanager once again appears healthy. FYI: registry changes suggested by this AskUbuntu answer didn't make any difference earlier

Pro Tip Although I didn't need it, I felt better making the above change(s) after creating a backup of the WSL2 filesystem as described in this comment. The one for Docker is similarly located at: C:\Users<you>\AppData\Local\Docker\wsl\data

jsteenri avatar Nov 19 '20 16:11 jsteenri

This is another long-running issue that encapsulates many separate issues with a similar symptom. Since the original issue, we have fixed many things that could display that symptom. I'm going to close this issue so that we can accurately track new issues and not lose anything. If you see an issue with unstable Hyper-V or a hang in LxssManager, please file a new issue so we can gather logs and get it fixed. Thanks!

bpulliam avatar May 07 '21 13:05 bpulliam

Managed to fix the issue by disabling all WSL related features, rebooting, then enabling them again and rebooting once more. Later I had to run wsl --set-default-version 2 again.

Neutrovertido avatar May 11 '21 17:05 Neutrovertido

Managed to fix the issue by disabling all WSL related features, rebooting, then enabling them again and rebooting once more. Later I had to run wsl --set-default-version 2 again.

Disabled Hyper-V plus WSL -> reboot -> enable them again -> reboot solved my issue!

JohnCido avatar Jan 09 '22 15:01 JohnCido