WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Slow WSL startup when network drive unreachable

Open capnader opened this issue 3 years ago • 24 comments

Version

Microsoft Windows [Version 10.0.22621.963]

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.15.79.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

1- Define some network drive 2- Shutdown WS to which network drive is linked to. 3- Run WSL distro and it will take about 2mn and more for startup.

Expected Behavior

image

image

Actual Behavior

image

image

Diagnostic Logs

WslLogs-2022-12-17_22-41-51.zip

capnader avatar Dec 17 '22 22:12 capnader

Same issue. Everything works fine after disconnect SMB disks.

Catofes avatar Jan 30 '23 08:01 Catofes

I see the same slowness of WSL2 start with some unreachable network drives, see the attached log. dmesg.txt

LeosBitto avatar Feb 25 '23 08:02 LeosBitto

This issue is still present in the WSL2 version 1.1.3. dmesg-1.1.3.txt

LeosBitto avatar Mar 19 '23 09:03 LeosBitto

I can confirm, that disconnecting SMB drives solved my extremely slow startup issue. I'm using WSL for more than a year, and this became an issue only recently, so it was introduced in one of the updates.

tilenkranjc avatar Apr 21 '23 12:04 tilenkranjc

Can this be finally fixed please? I cannot unmap my drives. WSL should launch immediately even when mapped network drives are inaccessible. This almost 1 minute delay is very annoying.

oomek avatar Apr 22 '23 11:04 oomek

Ok, this is INSANE! 4 minutes and 17 seconds of delay in WSL session start with 6 inactive mapped drives. Fixing this should have the highest priority.

image

oomek avatar Apr 22 '23 13:04 oomek

image

Please try the following workaround and let me know if it worked for you. It actually helped on my machine.

Add ProviderFlags DWORD and set it to 1 inside each mapped drive letter you find in the registry under Computer\HKEY_CURRENT_USER\Network\ and restart your PC

Mentions: https://github.com/microsoft/WSL/issues/9377 https://github.com/microsoft/WSL/issues/8569 https://github.com/microsoft/WSL/issues/6765

oomek avatar Apr 23 '23 11:04 oomek

image

Please try the following workaround and let me know if it worked for you. It actually helped on my machine.

Add ProviderFlags DWORD and set it to 1 inside each mapped drive letter you find in the registry under Computer\HKEY_CURRENT_USER\Network\ and restart your PC

Mentions: #9377 #8569 #6765

Have tried the workaround but still having the same issue. WSL startup took about 2mn for having only one network drive unreachable.

image

image

image

capnader avatar Apr 23 '23 15:04 capnader

Same issue here. I'm glad that I found the problem after a few hours of googling, because I had to wait for 4+ minutes for every WSL instance start. This is insane.

bitekas avatar Apr 24 '23 09:04 bitekas

Same issue. Likely introduced with an update, WSL startup was much faster before even with unavailable network drives.

KonstantinKhabarlak avatar May 18 '23 16:05 KonstantinKhabarlak

Also having the same issue, how is this not fixed yet?

dm9bbadd4 avatar Jun 06 '23 11:06 dm9bbadd4

Hello, same issue here, without much luck in searching for a solution.

otaolafranc avatar Jun 12 '23 06:06 otaolafranc

Same issue here, so weird this has been a issue for so long. Was searching for ages for the cause of slow wsl startups until I found this.

Rick-van-Dam avatar Jun 25 '23 21:06 Rick-van-Dam

I triggered this problem by mapping drive letter U: to the WSL Ubuntu drive (i.e. \\wsl.localhost\Ubuntu). Even disabling automounting in the wsl.conf didn't help.

ak2 avatar Jun 27 '23 09:06 ak2

I have mostly inaccessible SMB drive on my laptop that only works when connected to company VPN. WSL startup goes from seconds to 5 minutes when this drive is mapped. Unfortunately I can't unmap it as I am not privileged enough to do so.

blami avatar Aug 15 '23 21:08 blami

As soon as I removed all unreachable network drives, startup time dramatically increased.

Erw1n avatar Aug 24 '23 12:08 Erw1n

I'm having the same problem on WSL2 v2.0.x as well (I tested up to 2.0.11). It took ~5 minutes for wsl to startup, but it got fixed once I removed my unreachable mapped network drives.

MahdiGhiasi avatar Jan 16 '24 09:01 MahdiGhiasi

Also having the same issue. I tried to use these settings in wsl.conf

[automount] enabled=false

and mount the drives that are always present in /etc/fstab but that doesnt help. Same issue with really slow startup time anyway. Only thing that works is to umount the drives in windows (no drive letter attached) and everything works fine but this shouldn't be needed.

Please fix!

andreas-thoren avatar Feb 17 '24 09:02 andreas-thoren

Does WSL have a way to inject a script that temporarily disables networking during startup? Unmounting network shares is not an option for me as well

AlexanderSalge avatar Mar 09 '24 10:03 AlexanderSalge

It started to fail for me this week with 3 network locations connected, WSL become almost useless overall:

  • ~10 minutes startup time.
  • Build times for projects extended dramatically (could take 1 hour to build only 1-2 files)
  • I could not even run succesfully df -h because it just hanged forever.

WSL version was 1.2.5

The dmesg log messages were pointing to this issue:

[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[Wed Mar  6 09:35:34 2024] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2

I unmounted/disconnected the Windows network locations & updated WSL to latest ver: 2.1.4 Created again the network locations, started WSL & now it works smooth as before.

borjamunozf avatar Mar 12 '24 10:03 borjamunozf