WSL: WSL2 HTTPS Connections Timeout
Environment
Microsoft Windows [Version 10.0.19042.685]
Release: 20.04
WSL2
Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020
Steps to reproduce
For example, trying to install NVM fails with a timeout error.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
After further debugging I found that the script just tries to clone the repo using https. I then tried to clone any repo via https and it fails with a timeout error, SSH works perfectly fine.
WSL logs: https://gist.github.com/edarioq/0198119f6c461b4025a3344a354b8d20
Expected behavior
https connections should work and git clone should work without any timeouts.
Actual behavior
fatal: unable to access 'https://github.com/nvm-sh/nvm.git/': Operation timed out after 300038 milliseconds with 0 out of 0 bytes received
Things I’ve tried:
- Changing MTU
- Reinstalling (brand new Windows and Ubuntu install)
- Disabling IPv6
- Updating Git
- Updating network drivers
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 24
- Comments: 41
Awesome support from the Microsoft team, guess it’s back to good old Mac OS for my development needs.
4 years later, still an issue.
Please try the following in your WSL
I can install with curl.
Was related to an open VPN connection for me. Once that was closed no more timeouts.
I’m running into https timeouts on WSL with windows 11. Just checking in.
Hello,
I’ve got the same trouble and try all this solution:
Current : Windows 10 22H2 19045.2251
Everything doesn’t work, at least i’ve found a solution for me, change the MTU of the eth0 in WSL to 1350, after this my apt update / upgrade / install work properly.
This is command to use
sudo ip link set dev eth0 mtu 1350If anyone end up here, make sure you try updating your kernel (powershell as admin): wsl --update.
In case anyone wonders what to do in this situation, my solution for now has been to install Telerik Fiddler on the Windows side, and setup my Linux machine to use it as a proxy. Because of that trick, all traffic to the web is routed through Windows instead of Linux, and that has prevented the network connection from hanging so far.
Additional instructions
I think the issue is more generic than some HTTPS URLs. I suspect it’s a Hyper-V related TCP NAT problem. ICMP echo requests are transmitted and responded and UDP-based DNS queries can succeed also. No TCP connection can be established though (eg. with
nc). I’m on Windows 10 x64 Pro 20H2 19042.928, WSL2 running OpenSuSE Tumbleweed.Want to chime in here to add my own experience with this issue. All
httpsrequests would fail by timing out, and every fix listed here didn’t help. It clearly wasn’t a DNS issue because urls could be correctly resolved to IP addresses. Ultimately it turned out that that the Hyper-V firewall was blocking WSL in a way that caused it to fail. Running these commands in powershell fixed my issue:The first command modifies the firewall to allow all inbound connections by default. This should probably be a bit more precise to avoid unwanted traffic, but as a first pass it worked. The second command is necessary to prevent the host firewall policy from overriding the locally set values. After this, everything worked as expected.
I was having the same problem, but only after upgrading WSL to WSL2.
I tried changing SSH keys, switching to HTTPS, deleting the repo and failing to clone back again, blaming my VPN, punching my screen… the error wouldn’t budge.
Then I just used powershell to downgrade it back:
And then everything started working again 🤡
Same problem.
wsl --updatecan’t solve problem becauseThe most recent version of Windows Subsystem for Linux is already installed.Any suggestions?
If someone stumbles here, i couldnt get brew package to install, so fiddling with MTU seems to fix it (althought i did try a couple of things). https://github.com/microsoft/WSL/issues/4698#issuecomment-814259640 Note that on my side mtu 1350 vEthernet (WSL)
Well I am getting the same issue; about an year later than the Original Post. I’m on
Microsoft Windows 11 Pro | Version 10.0.22000.493, and I run into the same issue on WSL2.An automatic one by Windows update, or a manual one?
Update :
I went to the actual Github repository and there they had this option :
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bashIt seemed to work, and
$ command -v nvmreturnsnvmafter a restart of the terminal. I do not know if this is the right way to do this, however.