Skip to content
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

Cannot Update Ubuntu or access internet #5831

Closed
n0x-nam0n opened this issue Aug 30, 2020 · 17 comments
Closed

Cannot Update Ubuntu or access internet #5831

n0x-nam0n opened this issue Aug 30, 2020 · 17 comments
Labels

Comments

@n0x-nam0n
Copy link

Windows 20H2 19042-487
Release: 18.04
Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020

Steps to reproduce

Download Ubuntu 18.4 or Kali or 20.4 and Run
Open Terminal and run 'Ping google.com' 'curl google.com' 'sudo ifconfig eth0' 'sudo apt update'

kixone@LAPTOP-0UJF4A58:/opt$ ping google.com
ping: google.com: Temporary failure in name resolution
kixone@LAPTOP-0UJF4A58:/opt$ sudo ifconfig
kixone@LAPTOP-0UJF4A58:/opt$ sudo ifconfig eth0
eth0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:15:5d:52:0f:de txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

kixone@LAPTOP-0UJF4A58:/opt$ curl http://google.com
curl: (6) Could not resolve host: google.com
kixone@LAPTOP-0UJF4A58:/opt$ sudo apt update
Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
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/bionic/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
kixone@LAPTOP-0UJF4A58:/opt$

I would like to be able to use Linux, update and access the interweb.

@JacobsonLantern
Copy link

Did you try the same command in your Windows' Command Prompt / PowerShell? This is to try and ruling out ISP's DNS Server issue.

If Windows still connected without problem, did /etc/hosts file modified lately?

If both of the question answered as no, then I presume the problem is with Hyper-V virtual switch. Are you using WSL version 1 or 2?

@n0x-nam0n
Copy link
Author

Yes I was able to ping google.com without any problems in PowerShell. I also found that if I switch the box to WSL1 everything works properly. ( wsl --set-version kali-linux 1)

The etc/host file was never modified as this is a fresh install.
cat /etc/hosts

This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:

[network]

generateHosts = false

127.0.0.1 localhost
127.0.1.1 LAPTOP-F3OSR0IR.localdomain LAPTOP-F3OSR0IR

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

I am trying to use WSL2, I was able to use it before but after the 20H2 update i think something went wrong. I rolled back to Win 10 2004 Build 19041.487 and it still does not work.

@ad-on-is
Copy link

ad-on-is commented Sep 1, 2020

I'm having exactly the same issue right now. I cannot connect to the internet from WSL 2.
Windows 10 20201

@n0x-nam0n
Copy link
Author

He mentioned above that it may have to do with the hypervisor switch. Did you do anything with hypervisor? I didn't. It's still happening on a fresh install. I don't think we have hypervisor manager in win10 - not Pro.

@BatmanAoD
Copy link

@n0x-nam0n I recommend also looking at #5821.

@JacobsonLantern
Copy link

He mentioned above that it may have to do with the hypervisor switch. Did you do anything with hypervisor? I didn't. It's still happening on a fresh install. I don't think we have hypervisor manager in win10 - not Pro.

Well, WSL2 is Hyper-V without all the management features in the full version. Hyper-V manages the networking. I no longer have W10 Home (upgraded my Surface Go to Pro lately), but if you open network adapters, there should be vEthernet (WSL), which is Hyper-V default vSwitch for WSL2. However, even in W10 Pro, WSL2 vSwitch seems unmanageable (e.g. cannot set static IP, and if you open vSwitch manager, it won't appear in the list.).

@therealkenc
Copy link
Collaborator

Please collect WSL logs and post the backlink to the feedback item here. Also list list your third-party networking software installed on Windows, if any.

@ParitoshGavali
Copy link

ParitoshGavali commented Sep 7, 2020

I have this issue with Dial-up connection. commands like 'ping google.com' work, but 'sudo apt install ' gets stuck at "0% waiting for headers".
In WiFi every thing works correctly!
image

@luizwhite
Copy link

luizwhite commented Sep 7, 2020

No success trying to update or access internet.
https://aka.ms/AA9kke5

EDIT: it magically worked after this
EDIT2: it stopped working dunno why. sudo apt update not working, but ping is.
EDIT3: it worked again after unsetting and setting again mtu 1350 a couple of times

@cyshih73
Copy link

I got no internet connection on WSL2 since yesterday. Ping, dig, update, or anything.
Disable the IPv6 for both my wifi adapter and vEthernet (WSL) adapter solved the problem.

@banrovegrie
Copy link

I was facing a similar issue.

My Reason: My /etc/resolv.conf had garbage non-ASCII characters in it.

Basic Reason: Your DNS settings is incorrect or incompatible.

Fix: Do cat /etc/resolv.conf to check the contents of the conig file. If a line similar to nameserver 192.168.1.1 is missing add it to the file. The number 192.168.1.1 depends on the internal address of your host, so be careful of that.

@lantex
Copy link

lantex commented Nov 26, 2020

I got no internet connection on WSL2 since yesterday. Ping, dig, update, or anything.
Disable the IPv6 for both my wifi adapter and vEthernet (WSL) adapter solved the problem.

Just DISABLE the IPv6 for vEthernet (WSL) adapter works for me. Many thanks.

@lukee1234
Copy link

If you modified, moved or compressed the temp folder, look at #5437 for the solution

@eldano1995
Copy link

Checkout my comment: maybe it helps: #5061 (comment)

@cmendesfirmino
Copy link

I'm just change /etc/resolv.conf nameserver to the windws DNS server IP. And worked.

@eddyp
Copy link

eddyp commented Nov 19, 2021

Just a ping from 2021, seeing the same issue. Workaround was to switch to wsl version 1.

wsl --set-version Debian 1

I am seeing this on windows 10.0.19042 Build 1942

Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests