Closed Mystic8b closed 6 months ago
Same issue for me also. Just installed ubuntu 18.04. not able to update
The problem is resolved after reinstalling on ubuntu 20.04. Winver 19041.208
okay
I have the same issue with Windows 19041.264
If I revert back to WSL 1 everything works, just WSL 2 doesn't connect
If I revert back to WSL 1 everything works, just WSL 2 doesn't connect
Strange, everything works for me on the same build
If I revert back to WSL 1 everything works, just WSL 2 doesn't connect
Strange, everything works for me on the same build
For me still, an issue, look at the powershell window, just error when I enabled wsl2
@rromanv Try something like ping 216.58.192.164
. Does it work?
@rromanv Try something like
ping 216.58.192.164
. Does it work?
This works, that mean I have issues with DNS resolving?
I followed up this, but instead of Google DNS I pointed to my company DNS (I need resolve of internal services/servers) https://github.com/microsoft/WSL/issues/4285#issuecomment-522201021
Yes, that looks like DNS problem. You can see plenty of threads with similar issues but not an universal solution.
i have the same issue when i'm connected over WiFi however i noticed that when i'm connected over ethernet it works well. i think issue is related to sharing network process between network cards over Hyper-v engine. WSL2 is not an emulation anymore but a specific hyper-v virtual machine that uses same network connexions that an hyper-v vm to connect (like virtual switch)...
I turned off my VPN and I did not have an issue updating.
Tried everything, still can't get it to work. It works in WSL 1 but not 2.
Turning off my VPN fixed the issue for me as well.
Tried everything, still can't get it to work. It works in WSL 1 but not 2.
Same.. Also tried to update my network driver, and to reinstall WSL, but nothings changes:
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Connection failed [IP: 91.189.88.142 80]
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Connection failed [IP: 91.189.88.142 80]
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Connection failed [IP: 91.189.88.142 80]
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Connection failed [IP: 91.189.88.142 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Connection failed [IP: 91.189.88.142 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Connection failed [IP: 91.189.88.142 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
But, if i try to connect over Ethernet, or through my phone's wifi (routing), it works I'm not an advanced user, but I did everything right, it just dont work..
I guess these three are related
I had Same problem with WSL2 , ubuntu distro. Basically you are not able to reach ubuntu servers on TCP connection. & that is why Ping & DNS resolution is working. Solution - Please check your Endpoint protection/Anti-virus agent/Windows Firewall. Try to disable them & then give a try. It worked for me. Later you can make permanent security exception for your wsl ubuntu. Now i am on wireless connection, my VPN connected, Security exception made on symantec protection, & still i can update all packages. HTH
Turning off public network firewall solved it temporarily. Making the following firewall rule, in powershell, solved it completely:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
Turning off public network firewall solved it temporarily. Making the following firewall rule, in powershell, solved it completely:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
Not a PS expert here.. What exactly this code is doing?
Turning off public network firewall solved it temporarily. Making the following firewall rule, in powershell, solved it completely:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
Not a PS expert here.. What exactly this code is doing?
Makes a new windows firewall rule that allows the standard WSL interface to receive inbound packets (=> internet connection). Copy and paste it in the PowerShell admin console, after if you open Windows Firewall you will see the new created rule
@P1100 The rule didnt work for me.. Same issue.. Actually i have Bitdefender and I also tried to disable the firewall, but nothing changes..
The only thing that works until now is run sudo ifconfig eth0 mtu 1350
command everytime i start my WSL, and the internet magically start working:
https://github.com/microsoft/WSL/issues/5061#issuecomment-706714878 -> Solution is working for me. on windows defender Widnows 10 Pro 2004
I can't update too.
Nor the firewall solution or setting the mtu did work for me :-(
Same issue with DNS resolving in WSL2 Debian fresh install. Editting /etc/resolv.conf and replacing bad line with "nameserver 8.8.8.8" solved the problem for me.
Same issue with DNS resolving in WSL2 Debian fresh install. Editting /etc/resolv.conf and replacing bad line with "nameserver 8.8.8.8" solved the problem for me.
Well I did add the entrry nameserver 8.8.8.8
, but beind coorporate VPN apt-get update
does not work.
Adding the DNS of from the VPN allows to access coorporate network but then that's it.
Digging...
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
Your rule did worked for me: New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
I'll give a little more details about my situation, because it might not applied to everyone:
I was using the internet connection of my company, which uses it's own proxy company.proxy.com:port (I use proxifier to control which apps should have Internet access using that proxy).
Also, because of the country I lived in, I don't have access to some websites, so I need to use a VPN (I use profixier to control which apps must should make the request via VPN and what should not).
Funny enough, it seems that http://archive.ubuntu.com/ubuntu belongs to one of those websites I don't have access to, so the requests that my WSL make should go through the VPN (which is hard to do because proxifier does not detect any network traffic from wsl.exe, the same as when it doesn't detect network traffic from cmd.exe when we do ping google.com)
So, that's more or less my situation. This is what I did: 1 - I disabled the IPv6 element from Ethernet Network and allowed "Used share network" (but I don't think this had anything to do on solving the issue, so you might try skipping this step)
2 - Installed CCProxy, and mounted a proxy server on my machine
3 - Created a rule on proxifier so that the connection of the VPN app goes through the company proxy
4 - Created another rule on proxifier so that everything that goes through CCProxy goes by the VPN app
5 - I run on wsl: sudo nano /etc/apt/apt.con
6 - Added this line to apt.con: Acquire::http::Proxy "http://`**CCProxy_configured_IP**:**CCProxy_configured_HTTPS_port**";
7- Added rule using Powershell as admin:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
And I think that was it: Now, every wsl conecction (at least when I do apt-get update) is allowed (by rule in step 7), then it makes the request to CCProxy (steps 6 )), and then CCProxy forwards the request to the VPN (step 4, 3)
Adding this firewall rule did not work for me.
Running Windows 10 Pro 2004 with Ubuntu 20.04 on WSL2
Downgrading to WSL1 "fixes" the issue.
EDIT: After some more google searching I stumbled upon this comment from #5336 which fixed my issue.
I believe there was some trouble going on with the Hyper-V network adapter for WSL, but this is only my uneducated guess.
Small addition for my specific case: I had to configure the proxy settings for APT in order to be able to successfully run update
and upgrade
commands. If that's the case for you guys. try this:
Create a new configuration file named proxy.conf proxy.conf
> sudo touch /etc/apt/apt.conf.d/proxy.conf
Open the proxy.conf file in a text editor.
> sudoedit /etc/apt/apt.conf.d/proxy.conf
Add the following lines to set your corporate HTTP(S) proxy.
Acquire {
HTTP::proxy "http://corporate.proxy.address.com:port";
HTTPS::proxy "http://corporate.proxy.address.com:port";
}
Save your changes and exit the text editor.
You should be able to run apt command next time.
Thanks @Nguimjeu, appreciate you sharing this. Worked for me on WSL2 Ubuntu 20.04
Windows 10 1909 Build 18363.1316
Corporate VPN (AnyConnect VPN Client)
Corporate Proxy
It is fucking amazing to see this bug has not been solved for years, I was planning to use windows for development, and I found that even gcc could not be installed in wsl due to this bug. What the hell Microsoft is doing?
Small addition for my specific case: I had to configure the proxy settings for APT in order to be able to successfully run
update
andupgrade
commands. If that's the case for you guys. try this:
- Create a new configuration file named proxy.conf
proxy.conf
> sudo touch /etc/apt/apt.conf.d/proxy.conf
- Open the proxy.conf file in a text editor.
> sudoedit /etc/apt/apt.conf.d/proxy.conf
- Add the following lines to set your corporate HTTP(S) proxy.
Acquire { HTTP::proxy "http://corporate.proxy.address.com:port"; HTTPS::proxy "http://corporate.proxy.address.com:port"; }
- Save your changes and exit the text editor.
You should be able to run apt command next time.
I use this and the seventh step of this https://github.com/microsoft/WSL/issues/5061#issuecomment-756457106 and works, all was because i'm behind a proxy and I have to tell linux my credentials to access
Had the same issue on OS Build 19042.906. For me the issue came from my anti-virus software. Imagine the issue could also come from VPN level network traffic restrictions. General solution might be to turn off anti-virus/VPN, do sudo apt-get update
, and turn anti-virus/VPN back on. This clearly may not be the best idea for those with more credible security threats, but could be an acceptable risk for more general users.
For my specific anti-virus, Symantec, I went to Change Settings, Configure Settings for the Network and Host Exploit Mitigation, and under the Firewall tab changed the Unmatched IP Traffic Settings from Allow only application traffic to Allow IP traffic. There may be similar settings in other anti-virus software that could cause similar issues. If this solution fails, there may be other network level restrictions causing issues, so that might be the best place to start. Hope this helps others out with the same issue.
This is very annoying and still, this bug has not been solved.
Check what antivirus you are using. I was having McAfee and endpoint security enabled. If disconnect End Point security firewall connectivity will work straightaway (no reboot required).
https://kc.mcafee.com/corporate/index?page=content&id=KB91411
Small addition for my specific case: I had to configure the proxy settings for APT in order to be able to successfully run
update
andupgrade
commands. If that's the case for you guys. try this:
- Create a new configuration file named proxy.conf
proxy.conf
> sudo touch /etc/apt/apt.conf.d/proxy.conf
- Open the proxy.conf file in a text editor.
> sudoedit /etc/apt/apt.conf.d/proxy.conf
- Add the following lines to set your corporate HTTP(S) proxy.
Acquire { HTTP::proxy "http://corporate.proxy.address.com:port"; HTTPS::proxy "http://corporate.proxy.address.com:port"; }
- Save your changes and exit the text editor.
You should be able to run apt command next time.
After this exact steps i just entered "sudo apt update". got an bunch of errors. then, i commented the proxy file contents. then I executed the same command "sudo apt update". It works fine. ' FYI: I didn't connected through the VPN
Updating Windows worked for me. Make sure to check "optional updates" as well.
@P1100 The rule didnt work for me.. Same issue.. Actually i have Bitdefender and I also tried to disable the firewall, but nothing changes..
The only thing that works until now is run
sudo ifconfig eth0 mtu 1350
command everytime i start my WSL, and the internet magically start working:terminal evidence
Thanks a lot. That works. I'm using L2TP to access the Internet, and I think this error only happens when I using it. Maybe big MTU can't work in L2TP.
In the Ubuntu shell do this:
sudo hwclock --hctosys
It worked for me.
I used WSL1 then upgraded to WSL2 from last 2020 after that faced this issue till now, I gave up and swap to use Macbook 🍎 🤪 🤪 Today when I'm trying to update Windows 11 then I found the solution, just disabled my Antivirus Software Symantec Endpoint Protection Microsoft Windows [Version 10.0.19043.1083] WSL2 Ubuntu 18.04 SEP ver:
Thanks God, It worked finally but such WSL2 👎, change the solution for network pleaseeeee!!!!!!!!!!!
Same issue with DNS resolving in WSL2 Debian fresh install. Editting /etc/resolv.conf and replacing bad line with "nameserver 8.8.8.8" solved the problem for me.
Well I did add the entrry
nameserver 8.8.8.8
, but beind coorporate VPNapt-get update
does not work. Adding the DNS of from the VPN allows to access coorporate network but then that's it. Digging...
Do ipconfig /all, get the DNS servers, for example to me it was : 172.x.x.x and 172.x.x.x Edit your /etc/resolv.conf, if with only "nameserver 8.8.8.8" doesn't work, add the 2 dns servers as follow
nameserver 172.x.x.x
nameserver 172.x.x.x
I'm still having this issue on a fresh install today with everything updated. Adding 8.8.8.8 instead of the default nameserver helped but I also did near everything in those threads.
Finally ditched wsl2.
I was having this same problem. My antivirus is Avast, I just disabled it for a few minutes and the command worked.
@Adriano-Santtos I had the same problem and disabling Avast helped. But does not seem like a solution. Please update if and when you resolve this. My OS build info:
Edition Windows 10 Home
Version 20H2
Installed on 8/18/2021
OS build 19042.1202
Experience Windows Feature Experience Pack 120.2212.3530.0
On further Googling, I found this solution and it seems to work: https://github.com/MicrosoftDocs/WSL/issues/481
Check what antivirus you are using. I was having McAfee and endpoint security enabled. If disconnect End Point security firewall connectivity will work straightaway (no reboot required).
https://kc.mcafee.com/corporate/index?page=content&id=KB91411
McAffee product was in our case the problem. Thanks @kbillore for pointing us into this direction!
Check what antivirus you are using. I was having McAfee and endpoint security enabled. If disconnect End Point security firewall connectivity will work straightaway (no reboot required). https://kc.mcafee.com/corporate/index?page=content&id=KB91411
McAffee product was in our case the problem. Thanks @kbillore for pointing us into this direction!
I think we can close this open thread now.
Check what antivirus you are using. I was having McAfee and endpoint security enabled. If disconnect End Point security firewall connectivity will work straightaway (no reboot required). https://kc.mcafee.com/corporate/index?page=content&id=KB91411
McAffee product was in our case the problem. Thanks @kbillore for pointing us into this direction!
I think we can close this open thread now.
But the issue still hasn't been fixed. I still need to have 8.8.8.8 in /etc/resolv.conf which isn't ideal. This wasn't an issue in wsl1.
Hi guys! After changing the version of WSL:
PS C:\WINDOWS\system32> wsl --set-version Ubuntu 2
Apt update doesn't work for me (and I waited for the execution of this command for about half an hour, why so long?...):
And release upgrade too:
In this case, everything responds:
After the rollback (
wsl --set-version Ubuntu 1
), there is no problem:My system:
Internet connected via PPTP client. And as you can see, the internet works on PC and on WSL. But the updates for some reason do not work ... I freaked out and reinstalled WSL completely, but it gave me nothing.