-
Notifications
You must be signed in to change notification settings - Fork 836
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 unable to connect to external network #6069
Comments
I've freshly update 2 days ago and facing the same issue. Read the same issues, tried the same thing but WSL2 machine no matter Ubuntu, Fedora or whatever cannot resolve anything even with proper resolv.conf. |
What's the output of |
This is what I see... rrazdan@RRAZDAN:~$ ip address show eth0 |
@ramrazdan The I'm curious If your DockerNAT ip address is 192.168.248.xyz, and so WSL assigned the wrong ip for linux. This command is useful to troubleshooting your problem Linux: You can start the investigation from |
From Windows
|
From WSL2 Ubuntu had a little less luck, ifconfig and traceroute are both not available.
|
Some new observations: Some things have improved, very mysteriously so and not quite there yet....
|
I cannot determine what caused this to change. Here's what I had been trying, none of which succeeded, incase that led to something.
Those are the only changes I consciously made. |
what's You can ping www.microsoft.com and archive.ubuntu.com to see if there is any error. If you hit If it still doesn't work, I would suggest you reboot the machine, then install another distro like debian and try to see if you still have ping issue. |
As requested... rrazdan@RRAZDAN-GB:~$ ip route
|
I managed to install traceroute manually and ran it for ubuntu and microsoft , shows * * * in all 30 hops
|
Breakthrough, sort of: The combination of
Now I can run sudo apt update. WSL Team -- this struggle with #1 is really something you could help improve, people shouldn't really have to struggle/tinker with this or it should be predictable. The firewall thing I get maybe hard to resolve for everyone in advance. |
Please help to collect the log next time when you see this problem. (The log you posted in this thread is empty) |
same issue |
Guys, can yuo help solve my internet issu too? Nobody answers me why that command works, since on windows is MTU 1500 |
Same issue even in fresh new system. |
I experienced the same symptoms as above. Found root cause was VPN. Turned off VPN and that resolved my issues. Wondering if anyone found the solution to allow over VPN. I will begin my own research and place a comment again here if I find a solution. |
Face similar issue but seems like unchecking IPv6 connection in Wifi properties resolve the issue for me. |
I have a fix for this issue.The problem is that by default, the internal network is NATted, with a dynamic IP which changes each time WSL is restarted. In order to avoid this, you have to select the external network, and choose the network interface you use to connect to the Inter,et, ethernet or Wifi. |
@jn-simonnet same issue to me . please give the resolution . |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Environment
Steps to reproduce
I cannot run any command that attempts to connect to the internet on WSL2.
Things run on WSL1 but on WLS2. The first thing I tried after installing wsl2, without making any changes, was to do a "sudo apt update" and that failed.
I then changed /etc/resolv.conf and /etc/environment to be exactly as on WSL1 and that did not work either.
I have another instance with WSL1 on the same machine which is able to communicate to the network as expected.
I have tried every combination - off VPN, on VPN, with proxy , no proxy, with an autogenerated resolv.conf, with a fixed resolv.conf - but been unable to make it work.
Having searched around, found of plenty of similar reported problems online, most advised modifying the /etc/resolv.conf. I have tried all of those, i.e. using nameserver 8.8.8.8 or my office DNS settings.
Some asked to check the Hyper-V Manager virtual switch manager. For WSL that shows the connection type as "Internal Network". I have tried changing it to external but that just errors. I also tried manually bridging the network connections but that doesn't seem to work either. That this is set to internal and the nameserver is pointing to some internal address on home network does seem to very suggestive of where the issue lies, but I have tried everything I can possibly find but it hasn't helped.
strace_sudo_apt_update.log
WSL logs:
https://aka.ms/AA9xncq
Expected behavior
Actual behavior
sudo apt update should connect to ubuntu website and update apt package information.
wsl2 should be able to connect to the internet.
It errors, complaining about
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Temporary failure resolving 'archive.ubuntu.com'
The text was updated successfully, but these errors were encountered: