Skip to content

all wsl.exe commands hang #4144

Closed
Closed

Description

@devsnek

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.

Activity

  1. onomatopellan commented on Jun 15, 2019

    @onomatopellan

    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?

  2. devsnek commented on Jun 15, 2019

    @devsnek
    Author

    Jonathan (@onomatopellan) everything you suggest also hangs

  3. devsnek commented on Jun 15, 2019

    @devsnek
    Author

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

  4. onomatopellan commented on Jun 15, 2019

    @onomatopellan

    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.

  5. craigloewen-msft commented on Jun 17, 2019

    @craigloewen-msft
    Member

    Seems related to issue #4047.

  6. kamil-mrzyglod commented on Oct 4, 2019

    @kamil-mrzyglod

    It occasionally happens on my PC running 10.0.17763.740.

  7. rlipscombe commented on Nov 5, 2019

    @rlipscombe

    Seeing this with 10.0.19013.1.

  8. arsdever commented on Aug 16, 2020

    @arsdever

    Observed 10.0.19041.388.

    • No response to any command. Just hangs
    • where wsl gives nothing
  9. kdbcinco commented on Aug 31, 2020

    @kdbcinco

    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

  10. kthompson commented on Sep 3, 2020

    @kthompson

    Also experiencing this with 10.0.18363.1049

  11. 8549 commented on Sep 15, 2020

    @8549

    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.

  12. emilsrits commented on Sep 28, 2020

    @emilsrits

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

  13. aadibajpai commented on Oct 20, 2020

    @aadibajpai

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

    [Version 10.0.19041.572] if that helps

    edit: double restart fixed it for now

  14. nickb937 commented on Nov 11, 2020

    @nickb937

    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: #4626 (comment)

  15. taseikyo commented on Nov 13, 2020

    @taseikyo

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

  16. 46 remaining items

  17. DanKaplanSES commented on Jan 24, 2024

    @DanKaplanSES
    Contributor

    jakob (@grandchild)

    Even shorter output than what Eugene Lakhanski (@WinniX) posted:
    ...
    C:\> tasklist /nh /svc /fi "services eq lxssmanager"
    ...
    But [killing that process] from the TaskManager/Details tab [works]. So hey -- at least no reboot required.

    I'm on Windows 10 so that might be the difference, but when I tried to kill this in the task manager, it displays me a pop up that forces me to restart UPDATE: I misunderstood the alert button. Clicking that shuts down the process, not the computer. :

    image

    It's worth stating that after I followed the recommended steps, it didn't make a difference: wsl.exe still hangs.


    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!

    I'm on Windows 10. Would anyone be able to explicitly list these features/services that should be disabled? I don't know if I'm doing it right because after restarting, WSL and the same set of hyper-v services were enabled automatically.

    UPDATE: It turns out "features" in these comments refer to Start Menu > Turn Windows Features on or off. Windows 10 has many settings with "features" in the name, so I wanted to disambiguate this detail for others.

    I still don't know what "WSL related features" means as it could mean many things. I'm assuming these:

    image

  18. mback4 commented on Mar 5, 2024

    @mback4

    I can really only replicate this problem by opening vscode from wsl/ubuntu and then forgetting to close the window when I let my computer go to sleep at the end of the workday. Coming back typically wsl has hung, won't respond to wsl --shutdown at all.

    Using taskkill to terminate the wslservice.exe fixes the problem for me.

  19. 1EDExg0ffyXfTEqdIUAYNZGnCeajIxMWd2vaQeP commented on Mar 25, 2024

    @1EDExg0ffyXfTEqdIUAYNZGnCeajIxMWd2vaQeP

    Killing wslservices.exe is not a good workaround, as it results in a bluescreen.

  20. caner-cetin commented on Mar 25, 2024

    @caner-cetin

    Killing wslservices.exe is not a good workaround, as it results in a bluescreen.

    thought my gmail glitched wtf is that name lmao, also I never got BSOD when killing wsl.exe, don't kill wslservices.exe

  21. luka-markovic commented on Apr 3, 2024

    @luka-markovic

    what revived it in my case was killing of all wsl related processes in taskmgr, then restarting lxssmanager service. It seems like every weekly windows update and subsequent mandatory restart (this is on a company laptop) messes it up. You also dont need to have hyper-v in enabled in features, just wsl and virtual machine platform.

  22. hicotton02 commented on Apr 4, 2024

    @hicotton02

    I have the same issue. I have even uninstalled any distros, disabled all features, rebooted, enabled the features, rebooted, and tried to reinstall the distro. It hangs still. I am on Win 11 with latest updates. At this point, I am looking at reinstalling Windows....

  23. sedlund commented on May 30, 2024

    @sedlund

    for me I had rclone configured as a service that mounts a remote network storage as a drive. and that storage was down.

    this caused all the wsl commands (wsl -l wsl --shutdown) to hang and WSL from starting.

    after stopping the rclone service wsl began working again.

  24. maxfelker commented on Aug 1, 2024

    @maxfelker

    Having the same issue with Window 10 Version 22H2 OS build 19045.4651. My issue was the my physical hard drive ran out of memory while I was using VS Code and building docker images. This comment tipped me off:

    taskkill /f /im wslservice.exe did the trick

    I right clicked on my terminal and Ran as Adminstrator then ran the command above. In the same terminal I then ran wsl.

    From there I was able to open WSL by either opening up the Ubuntu app from the start bar or typing wsl into my terminal running at user level. That resolved my issue, did not get BSoD.

  25. HernandoR commented on Aug 28, 2024

    @HernandoR

    Constantly experience this Issue, regardless reboots.

    1. go windows control panel, notices that WSL is not enabled,(though wsl is running). Enble and reboot-> wsl --shutdown still hangs
    2. Disable WSL in windows control panel, reboot. -> wsl --list --running shows my Ubuntu
    3. try wsl --uninstall cmdl shows error and fail, but the log shows uninstalled.
    4. try to call wsl --list --running no wsl is running,
    5. reboot and enable wsl in the windows control panel
    6. use wsl --update installed wsl. wsl --status seems correct to me ( version 2)
  26. vegerot commented on Feb 25, 2025

    @vegerot

    I am still getting this issue. Every wsl command hangs, including commands to kill wsl

  27. karmamaster commented on Apr 17, 2025

    @karmamaster

    Nothing of above work, anyone have ways to work around?

  28. elide-b commented on Jun 23, 2025

    @elide-b

    Give the WSL command enough time to time out, even up to 10 minutes, try disabling the features and restarting, and eventually you might be lucky enough to see a message like this:

    wsl: WSL installation appears to be corrupted (Error code: Wsl/CallMsi/Install/REGDB_E_CLASSNOTREG).
    Press any key to repair WSL, or CTRL-C to cancel.
    This prompt will time out in 60 seconds.
    Class not registered
    Error code: Wsl/CallMsi/Install/REGDB_E_CLASSNOTREG
    

    and pressing a key then actually updates and repairs the WSL installation

  29. syamsoul commented on Jul 21, 2025

    @syamsoul

    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.

    Thank you.... it worked for me..

    1. wsl --set-default-version 2
    2. reboot

    previous i use the above solution....

    but now, the wsl hang issue happened again on my laptop.....and i tried above solution, seems didn't work for me....

    i try to find another solution, and found out a new solution that worked for me, as below:

    1. Disable WSL windows feature
    2. Restart OS
    3. Enable WSL windows feature
    4. Restart OS

    It is going to work again without deleting any of your WSL environments

    Image Image
  30. JuanFontes commented on Sep 15, 2025

    @JuanFontes

    All commands weren’t working for me, they were all hanging. I restarted, and when I opened VS Code it connected to WSL with no issues. All settings (Hyper-V, Windows Subsystem for Linux, etc.) are correct. Anyway, a restart “fixed” it.

  31. paulangton commented on Sep 15, 2025

    @paulangton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions