-
Notifications
You must be signed in to change notification settings - Fork 823
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
WSL2 cannot connect to the internet after upgrading from WSL1 (TRIED EVERYTHING!) #6016
Comments
Please collect WSL logs and post the backlink to the feedback item here. Also please identify any third-party networking software that has been installed on Windows. |
same problem here =( |
Let me know if it worked...I nearly never update to preview builds but i might this time if it has the issue fixed. |
You can also check if the wsl is connected to the local network, for example, ping to the IPV4 assigned to the windows host, and vice-versa. You may already try this, but still, I'll leave what worked for me. I'm using Ubuntu 20.04, and Try to follow all the steps in order. Edit the #/etc/resolv.conf
nameserver 8.8.8.8 To hold the file and avoid wsl to replace it every restart, edit the file #/etc/wsl.conf
[network]
generateResolvConf = false Then in a windows command prompt execute this, before a new wsl session:
Taken from this comment, and this other comment |
After upgrade my Windows version, it worked fine. I hope it can work for you as well =) |
|
Strange..i did update to the preview build and no luck :( |
Here: https://aka.ms/AA9v0ml |
same problem |
same problem here. |
been pulling my hair out on this one..
# ipconfig
Ethernet adapter vEthernet (WSL):
IPv4 Address. . . . . . . . . . . : 192.168.41.241
Subnet Mask . . . . . . . . . . . : 255.255.255.240 # cat /etc/resolv.conf
nameserver 192.168.41.241
# ip route
default via 192.168.41.241 dev eth0
192.168.41.240/28 dev eth0 proto kernel scope link src 192.168.41.252 # sudo apt update
Err:1 https://packages.microsoft.com/repos/azure-cli focal InRelease
Could not connect to packages.microsoft.com:443 (13.80.99.124), connection timed out
Err:2 http://archive.ubuntu.com/ubuntu focal InRelease
Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable)
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable)
Err:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
# pwsh/cmd
wsl --set-version Ubuntu 1 |
Had same issue and tried every solution I found, including the resolv.conf one, and nothing worked until I tried this: Now it works perfectly. Maybe there should be a way for Windows check for that folder during WSL 2 install if it is absolutely necessary for connectivity. |
THIS WORKED!! FINALLY I'VE BEEN TRYING TO MAKE THIS WORK FOR ALMOST A MONTH!! This worked for me:
|
It's important to end current sessions with this commande
|
This did the trick for me. Thank you |
For me, it was the firewall, my bad. Long before I started using WSL, I thought I was being smart when I changed the public profile inbound connections rule from "Block (default)" to "Block all connections". After all, that computer never leaves my home and is always set to private profile. I changed the public profile rule back to the default, and "sudo apt update" etc. worked immediately. Why on earth are they using the public profile for WSL? |
Your solution worked for me, but only if I do not shutdown WSL. The fixed settings work immediately after saving the fixed I think the correct way to keep WSL from breaking DNS resolution on every boot, is to make the fixed |
Hi,
I'm currently running Windows 10 (version 2004 build 19041.508). WSL2 just doesn't connect to the network. I have tried three different distributions (Debian, Ubuntu 20.04 LTS & openSUSE Leap 15.2) and neither of them could connect to the internet by running either sudo apt upgrade or sudo zypper up (in case of opensuse).
The following is shown when i run
sudo apt update
on debian:Err:1 http://deb.debian.org/debian buster InRelease Temporary failure resolving 'deb.debian.org' Err:2 http://security.debian.org/debian-security buster/updates InRelease Temporary failure resolving 'security.debian.org' Err:3 http://ftp.debian.org/debian buster-backports InRelease Temporary failure resolving 'ftp.debian.org' Err:4 http://deb.debian.org/debian buster-updates InRelease Temporary failure resolving 'deb.debian.org' Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease Temporary failure resolving 'deb.debian.org' W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease Temporary failure resolving 'deb.debian.org' W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease Temporary failure resolving 'security.debian.org' W: Failed to fetch http://ftp.debian.org/debian/dists/buster-backports/InRelease Temporary failure resolving 'ftp.debian.org' W: Some index files failed to download. They have been ignored, or old ones used instead.
In response to this, I looked up for forums on such and did all the following (doing neither helped):
--> Editing resolv.conf to point to a functioning nameserver for the duration of the session. (As mentioned in #5256 (comment))
Also,
sudo ping 8.8.8.8
returned the following error:connect: Network is unreachable
--> I had protonVPN installed in my pc, i went ahead and uninstalled it (including the network drivers it came with)
--> Uninstalled all Hyper-V components, uninstalled all TAP based networking by uninstalling VPN clients i have installed (as mentioned in #5256 (comment))
--> Completely disabled Windows Firewall & Windows Defender Firewall
Doing all of them got me nowehere, whatsoever! WSL1 was doing great, but i need the features of WSL2 to let it interact with windows better than wsl1.
Looking through the issues in this github repo, a lot if has to do with WSL2's network connectivity. A kind request to the developers to fix the general network issues in WSL2 asap.
Any beginner-friendly help to this issue would be great! :)
The text was updated successfully, but these errors were encountered: