WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Starting WSL 2 distribution hangs forever

Open jonahsnider opened this issue 5 years ago • 55 comments

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 avatar Sep 02 '20 06:09 jonahsnider

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

jonahsnider avatar Sep 02 '20 06:09 jonahsnider

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

jonahsnider avatar Sep 02 '20 19:09 jonahsnider

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. https://github.com/microsoft/WSL/issues/5836#issuecomment-685809778

licanhua avatar Sep 02 '20 21:09 licanhua

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

jonahsnider avatar Sep 03 '20 00:09 jonahsnider

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.

piotr-kopacki avatar Sep 03 '20 17:09 piotr-kopacki

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 avatar Sep 04 '20 06:09 afromankenobi

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.

afromankenobi avatar Sep 04 '20 06:09 afromankenobi

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

jonahsnider avatar Sep 04 '20 07:09 jonahsnider

Restarting my PC caused the issue to keep reoccurring 😎.

jonahsnider avatar Sep 04 '20 14:09 jonahsnider

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

joaomarcoscsilva avatar Sep 07 '20 11:09 joaomarcoscsilva

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?

licanhua avatar Sep 08 '20 15:09 licanhua

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

mercurytoxic avatar Sep 09 '20 02:09 mercurytoxic

Uninstalling VirtualBox fixed this for me too

rc1 avatar Sep 09 '20 12:09 rc1

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

jonahsnider avatar Sep 09 '20 18:09 jonahsnider

There are no more endpoints available from the endpoint mapper.

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

alar77 avatar Sep 09 '20 20:09 alar77

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

Thanks so much @mercurytoxic !!!

kevinaboos avatar Sep 19 '20 05:09 kevinaboos

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.

Hammerstad avatar Nov 11 '20 16:11 Hammerstad

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. :(

Qusic avatar Nov 19 '20 14:11 Qusic

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.

dude0001 avatar Jun 08 '21 02:06 dude0001

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.

henry701 avatar Jul 13 '21 16:07 henry701

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

alecive avatar Oct 10 '21 18:10 alecive

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

@alecive image

About starting it automatically, I think it is the default. But for some reason, shit happens sometimes and it stops or doesn't start I think? Good luck.

henry701 avatar Oct 10 '21 18:10 henry701

Ok great I've changed the startup type from "Manual" to "Automatic (Trigger Start)". I am (was) primarily a Linux user, so I'm not super comfortable dealing with the internal workings of Windows. I'll keep an eye out to see if this changes anything!

alecive avatar Oct 10 '21 18:10 alecive

Second time I've seen this and the second time that a reboot fixed it. This time it happened with Windows Build 19044.1526. I didn't get a chance to try many of the other suggestions here, though I can say that every wsl command that I tried hung.

derekrprice avatar Feb 28 '22 18:02 derekrprice

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.

Thanks, this worked for me, mine is disabled damn.

nielpattin avatar May 04 '22 05:05 nielpattin

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.

ZzZombo avatar May 26 '22 02:05 ZzZombo

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?

JohnCido avatar Jul 15 '22 02:07 JohnCido

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

Cuberick-Orion avatar Jul 23 '22 14:07 Cuberick-Orion

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.

d4r5c0d3 avatar Aug 01 '22 06:08 d4r5c0d3

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

ghandim avatar Aug 24 '22 11:08 ghandim