-
Notifications
You must be signed in to change notification settings - Fork 799
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
Very slow network speed on WSL2 #4901
Comments
Same here. Especially upload speed was drastically reduced - 36.61 -> 3.85 Mbit/s |
Hi, same here. My download was drastrically reduced of 200Mbit/s to 2 Mbit/s. Is there a solution? |
I'm hitting this issue, as well. Very frustrating. |
Edit: After several reboots and adding the related folders as exceptions in Windows Defender as @jituanlin 's referred blog pointed out, and then tried removing the exceptions because I wanted to check which folder exception actually helped (so eventually theoretically equivalent to reboots-only, but who knows?), now in Also, the command Old comment:
Cheers |
After follow this blog |
Same here. Getting about 7Mbit/s on WSL2 and 30+ in Windows. Disabling Defender also made no difference for me either. |
Same here :
WSL 2 :
|
Oddly, I'm getting decent results from the Speedtest results...
|
Same issue here, dire network speed in WSL2. Performance with Linux or WSL is fine. |
Same here, Windows is about 60Mbps vs WSL2 14kbps !!!! |
I'm seeing 249.94mbps down / 15.42mpbs up on Windows, which is pretty much what I expect from my ISP. On WSL2, But
I'm on |
Just FYI. I have experienced extremely slow network speed as well, but it seems to be a temporary issue. Perhaps a local network issue? Right now in WSL 1 (2004 not insider) I get:
|
I was having a similar issue and found that switching from Wifi to Ethernet helped. Ethernet NIC is a "Killer E2500 Gigabit" |
Hello friends, |
don't have the problem on surface pro x (arm64) |
It gets better... my speedtest today (Ethernet): Windows: |
Hi all, I got the latest Windows 10 ver 2004 update. Switching from WSL1 to WSL2. I have the similar slow issue like you all had. But not particularly on the internet, it's more on Windows to Ubuntu via localhost access Windows Version: 2004 I run php development in WSL with Ubuntu 18.04.4, I have apache2, php7.2 and MariaDB running very well on WSL1 During development, I usually tunnel to my server to load ElasticSearch/Postgresql data, the tunnel is listen on localhost with respective port numbers. I do not have connection problem when running in WSL1, the speed is tremendous fast. It's fast like the data is loading on my machine itself. But when I switch to WSL2, I notice the connection is extremely slow. The initial loading took like 5-7 secs. Then the page would rendered. The hostname is mapped to 127.0.0.1, I've tried mapped on WSL2 Ubuntu private IP, the results are the same - Slow. I've capture the video and sharing with you all. Here is the video running on WSL1 https://www.youtube.com/watch?v=tNFtUUd2sG4 What I did was wsl --set-version Ubuntu 2, to upgrade the current Ubuntu distro to WSL2. Here is the video of the same development site running on WSL 2 (Please look at left bottom status bar) https://www.youtube.com/watch?v=JFYgzMHf2RU I've tried the comments on this thread, no luck getting it load fast like WSL 1. Hopefully this can be fixed, I've switched back to WSL1 and the speed is back to normal. You may refer to the video below, the result is instance. |
Just for people still looking for a complete solution Create this file in
And run Thats it, when you re-start your WSL distro, it should have the same speed as your Windows host Read more about this here: https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig |
In addition to @AlejandroAkbal 's answer, as far as i understood, running wsl without
|
I had the same very frustrating problem but i think i got a work around. I used https://github.com/ChrisTitusTech/winutil to reset Winsock (Reset Networking). It is under Maybe it helps someone! |
sooooo.... Fresh install of pretty much everything. Just upgraded to a 1.2Gbit down network link.
Windows: speeds ranging from 600mbit to 950mbit (i probably need to upgrade a switch between the network and myself to get over that) Enabling mirrored networking mode doesn't seem to do anything except break my portforwards. Per the WSL mirrored mode networking update doc, it indicates that that adds the ability to connect to the WSL VM from the LAN and to Windows servers from within the Linux VM. That already works without mirrored mode. Enabling mirrored mode causes everything to pretty much break, and if there is any speed up of networking, it's only very slight. After doing a network reset and rebooting, I am more consistently getting the 200mbit speeds than the 20mbit speeds, but it's still pretty low speed in comparison. Probably legitimately averaging closer to 50mbit, rather than the 1Gbit i should be getting. |
This worked for me |
Same here - toggling sharing on the network interface is the only thing that works reliably for me. (by toggling, I mean sometimes I need to disable then re-enable sharing when wsl2 gets slow. |
That immediately fixed it for me too. |
fwiw, after trying everything in this thread except network mode mirrored (which breaks WSL networking for me completely), still getting about 1/4 my total bandwidth in WSL at most, and 1/4 that inside WSL2 docker containers. docker/for-win#8590 |
This works for me, too. To be specific:
The download speed immediately improves in my WSL2 Ubuntu 22. I think the issue is probably with my using Wi-Fi, which is not properly forwarded to the container. |
netsh int ipv4 set interface "Wi-Fi" forwarding=enable worked for me |
It works very good for me too, thank you. I'm very happy :D I just want to note that enabling IP forwarding on your device can introduce potential security risks, including making your device a pass-through for possibly malicious traffic. It's important to proceed with a clear understanding of these risks and to take appropriate security measures. |
Interestingly -- GUI apps (at least, google-chrome) don't seem to be restricted. google-chrome I can hit 1.1gbps at fast dot com. at speedtest dot net, 900mbps. through speedtest-cli, max 250-300mbps. Make it make sense, please. :D |
This worked for me |
This should be the accepted answer. |
.... because if resetting the nameserver works for you, then probably your dns is misconfigured in windows. but also, dns is irrelevant to this problem. |
About this issue, I faced it as well when using the mirrored mode, but not when using NAT. So why in my case? Then mirrored mode came into place, and damn, was weird, but after while it made, mirrored is supposed to share the same IP/interface, meaning also same DNS, but I was using a static config and preventing WSL from automatically updating it. I've tested setting my nameserver to my local router, and worked like a charm and as expected. So to wrap up, to add to the checklist, verify if:
Hope it helps other lost souls out there |
If you have bridged connections with the WSL adapter and your WIFI adapter, it will also slow down. I had to delete the bridge adapter. |
so... i think we might have a flaw in speedtest apps. Speedtest cli consistently gets 300mbps or less for me, while speedtest in browser consistently is punching 900mbps now. Also, Docker Desktop has an absolute speedcap of 100mbps, it seems. |
I had very slow upload speeds on WSL2 and figured out that my problem was with my wifi adapter being used as an External Network on Hyper-V Virtual Switches. I just deleted the switch and got full upload speed again. |
I previously have the experimental
Temporary disable More permanent solution would be setting up Dev Drive and have WSL2 on Dev Drive (I don't know how to do that at the moment), probably need to wait for microsoft/devhome#748 |
This also fixed slow WSL2 downloads for me. |
Since the latest WSL2 update, I'm pulling in 400-500mbps pretty consistently. However, in Windows, I'm pulling 2Gbps. I'm also no longer throttled to 100mbps total in docker-desktop |
this one work for me, thank u |
Thank you very much, it helped. One question though, how did you find it ? Is it mentioned in docs or smth ? |
This works well for me. |
I see this problem, too. None of the suggestions mentioned above directly solves my problem, but it give me a right direction. In my case, my PC is installed an enterprise IT management software, it installed a virtual network adaptor, which supports higher network throughput than windows provided default, but it doesn't work well with WSL. So I just disable the feature, then problem solved. |
Holy $#*! I had updated host to use 1.1.1.1 but saw no difference. Didn't think about updating the DNS for Ubuntu itself, as I subconsciously presumed it would use the host's config for some reason. PSA: Just editing /etc/resolv.conf won't last since it usually gets overwritten on reboot, so you'll need to look into the proper way to permanently set your DNS depending on what distro and network manager and all that jazz. |
Windows build number:
10.0.19041.84
Dist: Ubuntu 18.04 LTS
I just installed WSL2 on my home computer for the first time and something i notice that i don't see on my work computer is that WSL2 has dramatically lower network speed (
wget
orgit clone
tested). Speeds on WSL seem to be about 10-20 kb/s wheras windows download speed seem to be correlating to my ISP spec of 100/10 Mbps or above.The text was updated successfully, but these errors were encountered: