Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting WSL 2 distribution hangs forever #5845

Open
jonahsnider opened this issue Sep 2, 2020 · 53 comments
Open

Starting WSL 2 distribution hangs forever #5845

jonahsnider opened this issue Sep 2, 2020 · 53 comments

Comments

@jonahsnider
Copy link

jonahsnider commented Sep 2, 2020

Environment

Windows build number: Microsoft Windows NT 10.0.20201.0
Your Distribution version: Ubuntu 18.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce

Open wsl.exe, wt.exe, or ubuntu.exe

Possible duplicate of #5836

wsl.exe

Running wsl hangs forever, or at least the 10 minutes I waited.
Running wsl --help works properly.
Running wsl -l hangs for several minutes but then seems to properly output.

wt.exe Windows Terminal

Opening Windows Terminal displays the error since my default profile of Ubuntu isn't working:

Could not find your default profile in your list of profiles - using the first profile.
Check to make sure the "defaultProfile" matches the GUID of one of your profiles.

WSL logs: Feedback app hangs, can't collect anything.

Expected behavior

WSL opens.

Actual behavior

WSL doesn't open. See 'Steps to reproduce'.

@jonahsnider
Copy link
Author

Turning off Hyper-V like #5836 said fixed the issue.

@jonahsnider
Copy link
Author

Had my PC BSoD and restart a bunch, same issue occurs. Hyper-V is still off

@licanhua
Copy link
Collaborator

licanhua commented Sep 2, 2020

Are you windows running on physical machine or Windows itself is a virtual machine? I hit the very slow response yesterday because I only allocated 1G memory and limited disk space to Windows.

Try disable swap file to see if it improve the time in your case.
#5836 (comment)

@jonahsnider
Copy link
Author

I am running Windows standard with several GB of RAM free.

@piotr-kopacki
Copy link

The same behavior on

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.20201.0 Microsoft Windows NT 10.0.20201.0

Also constant BSoDs on system shutdown.

@afromankenobi
Copy link

afromankenobi commented Sep 4, 2020

Someone knows how to fix this issue? Neither disabling HyperV nor write swap=0 fixed it for me. I have the BSoD on shutdown too. The last Insider's update seems to create this issue.

@afromankenobi
Copy link

afromankenobi commented Sep 4, 2020

Someone knows how to fix this issue? Neither disabling HyperV nor write swap=0 fixed it for me. I have the BSoD on shutdown too. The last Insider's update seems to create this issue.

Ok after about 10 minutes, Windows terminal says these:

There are no more endpoints available from the endpoint mapper.

[process exited with code 4294967295]

Running wsl -l -v takes min 4 minutes to respond, but it responds.
Still the PC takes forever to turn off, and fails with BSoD.

Please, if you need more information please ask. I will keep investigating / learning to solve it.

@jonahsnider
Copy link
Author

Updating to Microsoft Windows NT 10.0.20206.0 seems to have fixed the issue.

@jonahsnider
Copy link
Author

Restarting my PC caused the issue to keep reoccurring 😎.

@jonahsnider jonahsnider reopened this Sep 4, 2020
@joaomarcoscsilva
Copy link

I am having the exact same issue. At every windows update, WSL starts working again, but after the first reboot the problem is back.

@licanhua
Copy link
Collaborator

licanhua commented Sep 8, 2020

When the problem happens, can you check the disk usage? @isaporto reported that the disk is very busy.

If possible, could you please collect wsl log?

@mercurytoxic
Copy link

mercurytoxic commented Sep 9, 2020

Uninstalling VirtualBox fixed the problem of wsl2 archlinux distro hanging on start and wsl --shutdown taking >10mins to execute, reinstalling VirtualBox brought the problem back.

Build 20206.rs_prerelease.200828-1431

@rc1
Copy link

rc1 commented Sep 9, 2020

Uninstalling VirtualBox fixed this for me too

@jonahsnider
Copy link
Author

I forgot I even had VirtualBox installed. I uninstalled/updated and WSL works. What.

@alar77
Copy link

alar77 commented Sep 9, 2020

There are no more endpoints available from the endpoint mapper.

Having the same issue with Build 20206.rs_prerelease.200829-1431

@kevinaboos
Copy link

Wow, uninstalling VirtualBox and rebooting finally fixed it! I had also forgotten that I'd installed it.

Thanks so much @mercurytoxic !!!

@Hammerstad
Copy link

If you are dual-booting Linux and Windows, like I do - a VirtualBox installation on the Linux partition will influence WSL.
Uninstalling VirtualBox on Linux fixed WSL on Windows.

@Qusic
Copy link
Member

Qusic commented Nov 19, 2020

Windows 10 20H2 19042.630 kernel 4.19.128-microsoft-standard Ubuntu 20.04.1 LTS
Just encountered this today. Not sure how to capture useful logs but it happens consistently for me.
I dont have VirtualBox installed or Hyper-V enabled. And each time I tried to use VSCode remote container dev features from a WSL2 folder, my mouse cursor started to lagging, and several seconds later, I cannot open wsl shells and they hang forever. Restarting my computer can fix it but I still can't use remote container dev. :(

@dude0001
Copy link

dude0001 commented Jun 8, 2021

I was getting the error

WslRegisterDistribution failed with error: 0x800706d9
Error: 0x800706d9 There are no more endpoints available from the endpoint mapper.

For me, the issue was the Host Network Service was not running. I changed it to start automatically and started it up once manually. I was then able to launch Ubuntu and set it as the default in WSL 2.

@henry701
Copy link

I was getting the error

WslRegisterDistribution failed with error: 0x800706d9
Error: 0x800706d9 There are no more endpoints available from the endpoint mapper.

For me, the issue was the Host Network Service was not running. I changed it to start automatically and started it up once manually. I was then able to launch Ubuntu and set it as the default in WSL 2.

This fixed the problem for me today. Killing vmmem, starting the service and then using WSL2 worked normally, without a restart.

@alecive
Copy link

alecive commented Oct 10, 2021

@dude0001 @henry701 how can I check if the host network service is not running? And, how can I make it start automatically?

@ZzZombo
Copy link

ZzZombo commented May 26, 2022

Hm, I followed the advice of starting the hns service, and it appeared to fix the problem, allowing the installation process to continue, however, it got stuck due to an unrelated error (causing me to attempt to reinstall later). After I rebooted the machine to apply Windows updates, however, the service doesn't start anymore, so I can't install the needed WSL distribution. I can't figure why. I'm not even sure where to report this abnormality, so I resorted to writing here.

@JohnCido
Copy link

For anyone who's still having this issue occasionally like myself, I find this solution without rebooting your PC or tweaking services. I've used it twice and it worked perfectly.
In these cases, the LxssManager is somehow preventing the WSL2 from rebooting. Maybe this is worthwhile for MS to look into?

@Cuberick-Orion
Copy link

For me, the HNS service is the issue. Though I cannot start the service for some reason (error 1075).

@d4r5c0d3
Copy link

d4r5c0d3 commented Aug 1, 2022

I opened my WSL distro as admin from the start menu
It prompted me to it wanted to change something I accepted and now it is working again.

@ghandim
Copy link

ghandim commented Aug 24, 2022

Thank you all for the hints. Uninstalling minikube app was the trick for me (Win10).

@davisnw
Copy link

davisnw commented Sep 13, 2022

Experienced this issue, and my Host Network Service was running. However, restarting the service fixed the issue for me.

This can be done from an Administrator powershell prompt with

Get-Service -Name 'Host Network Service' | Restart-Service

@tahir-idrees-tenovos
Copy link

I faced this issue on Windows 11.

To fix, go to Windows Optional Features > Turn off the "Windows Subsystem for Linux" feature > Apply but do not restart. Then turn the feature back on. No need of restart and WSL started to run normally.

@ieei0214
Copy link

ieei0214 commented Dec 3, 2022

Turning off Hyper-V like #5836 said fixed the issue.

Just got the same issue. No response even I type "wsl --version".
Close the Hyper-V and then restart windows. WSL back to normal.

@Yuvix25
Copy link

Yuvix25 commented Dec 4, 2022

@tahir-idrees-tenovos

To fix, go to Windows Optional Features > Turn off the "Windows Subsystem for Linux" feature > Apply but do not restart. Then turn the feature back on. No need of restart and WSL started to run normally.

Worked like a charm, thanks!

@jhmaster2000
Copy link

For anyone who's still having this issue occasionally like myself, I find this solution without rebooting your PC or tweaking services. I've used it twice and it worked perfectly. In these cases, the LxssManager is somehow preventing the WSL2 from rebooting. Maybe this is worthwhile for MS to look into?

Just experienced this issue and this was the fix for me, after it got fixed I got the message:

Windows Subsystem for Linux is now available in the Microsoft Store!
You can upgrade by running 'wsl.exe --update' or by visiting https://aka.ms/wslstorepage
Installing WSL from the Microsoft Store will give you the latest WSL updates, faster.
For more information please visit https://aka.ms/wslstoreinfo

I've done this upgrade and it was successful, hopefully this "new version" is better and doesn't have this problem again...

@Pesky01
Copy link

Pesky01 commented Dec 17, 2022

Anyone know of any other fix? All WSL commands hang forever except --version and --help. I've tried the LxssManager fix, toggling HyperV/WSL features.

@rolkar-kivra
Copy link

Same problem. And I see that there are several different solutions above. This do not seem stable. Seems like using wsl is a bd choice, or at least premature. Maybe better in the future?

@mguzm4n
Copy link

mguzm4n commented Jan 2, 2023

For anyone who's still having this issue occasionally like myself, I find this solution without rebooting your PC or tweaking services. I've used it twice and it worked perfectly. In these cases, the LxssManager is somehow preventing the WSL2 from rebooting. Maybe this is worthwhile for MS to look into?

WHAT - I've been struggling with WSL boot problem and this solved it. I didn't even know what LxssManager do, but I can finally run WSL2. Thank you so much.

@mokeyish
Copy link

I also encountered this problem on windows 11, and I can't shut down and restart, I can only reset the computer.

@virtuosoo
Copy link

I also encountered this problem on windows 11, and I can't shut down and restart, I can only reset the computer.

after reset , i got same problem again soon

@yc0
Copy link

yc0 commented Mar 6, 2023

I also encountered this problem on windows 11, and I can't shut down and restart, I can only reset the computer.

You can try to adopt this configuration in .wslconfig to disable idle timeout
vmIdleTimeout=-1

This feature is added on Windows 11, and for me, it would lead the VM to "sleep forever."

You need to restart the WSL, when you possibly get stuck into "wsl --shutdown" and "inaccessibility". You can try this one w/o rebooting OS
Go Task Manager > find Windows Subsystem for Linux > right button and click End Task to restart WSL.

@dejayc
Copy link

dejayc commented Apr 6, 2023

This just started happening to me today - my Debian distros just kept hanging forever. Terminating the task in Task Manager didn't help.

I was able to resolve the issue by running command prompt in admin mode, and typing wsl -t debian. -t or --terminate caused the hung Debian window to immediately become responsive, printing the interactive command prompt.

@akunbeben
Copy link

Just in case, you have Valet installed just stop the valet services and it would run WSL normally.

@djidji09
Copy link

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

@davidalexisnyt
Copy link

I can reproduce this issue on my Windows 10 corporate laptop:

  1. Machine is plugged into 2 external monitors via USB-C and also to power.
  2. My Ubuntu session in WSL is running
  3. I unplug the power and USB-C monitors (usually to go to a meeting)
  4. Machine locks or goes to sleep
  5. I wake up the machine and now the vmmem process is pegged at 100%

The WSL session cannot shut down (wsl -t or wsl --shutdown just hangs;), starting a new WSL session hangs, attempts to kill the vmmem process reports "access denied". The only resolution is rebooting.

@ardianre
Copy link

ardianre commented Oct 8, 2023

I faced this issue on Windows 11.

To fix, go to Windows Optional Features > Turn off the "Windows Subsystem for Linux" feature > Apply but do not restart. Then turn the feature back on. No need of restart and WSL started to run normally.

if this is still happening, in my case, it needs to restart.

  1. disable WSL in features --> restart.
  2. enable WSL in features --> restart.

@samkearney
Copy link

My symptom is exactly the same as @davidalexisnyt

@vcfvct
Copy link

vcfvct commented Mar 23, 2024

I faced this issue on Windows 11.
To fix, go to Windows Optional Features > Turn off the "Windows Subsystem for Linux" feature > Apply but do not restart. Then turn the feature back on. No need of restart and WSL started to run normally.

if this is still happening, in my case, it needs to restart.

  1. disable WSL in features --> restart.
  2. enable WSL in features --> restart.

Thank you so much. Facing the same issue and for me I also have to Reboot after disabling WSL and then re-enabled.

image

@Chase-san
Copy link

I found uninstalling Ubuntu and installing Debian instead fixed my issues with it hanging.

@gocs
Copy link

gocs commented Jul 14, 2024

If your WSL 2 Instance suddenly just hangs, try to look at the other side like if the current disk might be already full.
that's what happened to me

@Prince-Singh-05
Copy link

Turning off Hyper-V like #5836 said fixed the issue.

Turning On the Hypervisor worked for me
for turning on -> search for "Turn Windows Feature On or OFF" -> scroll down -> check the "Windows Hypervisor Platform"

@earizon
Copy link

earizon commented Oct 30, 2024

I suffered a similar problem with Ubuntu 22.04 and an "normal" apt install.

A post-install script tries to index the file system. I hangs on /mnt/c due to my company antivirus.

I restart. The system hangs. I can not umount /mnt/c because I have no console access. :(

I can not fix it, I GOT fired, but I'm happy because no I can dedicate full time to hate Microsoft soooOOOOoouuu much for creating Windows and Office #humor

@jamasb-morteza
Copy link

jamasb-morteza commented Nov 7, 2024

this solution worked for me
in windows security settings -> App & Browser Control -> Exploit Protection -> Exploit Protection Settings
set Control Flow guard (On By Default) in System Settings
and in program settings tab remove vmcompute.exe if its present
reboot system (rebooting could takes some time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests