WSL icon indicating copy to clipboard operation
WSL copied to clipboard

[WSL2] Can't update Ubuntu, git clone, apt install, but ping works (Windows 1909)

Open TheoForay opened this issue 6 years ago • 39 comments

Environment

Windows build number: 18363.1082
Your Distribution version: Ubuntu 20.04 and Ubuntu 18.04
Whether the issue is on WSL 2 and/or WSL 1: It happened after I upgraded to WSL 2 and works fine in WSL 1

Steps to reproduce

sudo apt update, or git clone XXX can't connect. sudo apt update :

Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu focal-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/focal/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

I checked ipconfig on PowerShell, and my vEthernet adapter for WSL isn't disconnected, and I can confirm that, as ping 8.8.8.8 actually works.

TheoForay avatar Sep 23 '20 08:09 TheoForay

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.

therealkenc avatar Sep 23 '20 09:09 therealkenc

I would really like to follow the procedure to give more intel but unfortunately I don't have the Feedback Hub on my computer. I don't find a way to install it. Perhaps it's because it's on my company's laptop. Is there another I can provide you what you need?

TheoForay avatar Sep 28 '20 09:09 TheoForay

Having the exact same problem.

ttelfer avatar Oct 02 '20 17:10 ttelfer

Having the same problem. Things work fine when I reboot the computer, but after a while WSL 2 loses its connection to certain things (apt, mainly) while ping still works fine. Here's my feedback backlink: https://aka.ms/AA9tug5

maxlieblich avatar Oct 03 '20 23:10 maxlieblich

same problem

zhangshengsheng avatar Oct 10 '20 09:10 zhangshengsheng

For me, even ping stopped working

ad-on-is avatar Oct 27 '20 10:10 ad-on-is

I had exactly the same issue (Windows 10 version 1903 (build 18362.1139) + Ubuntu 18.04 though WSL2) . It turns out that my wifi was configured in Windows as "public" network. Switching to "private" fixed the problem. Hope this can help

patrickhoebeke avatar Oct 28 '20 08:10 patrickhoebeke

I had exactly the same issue (Windows 10 version 1903 (build 18362.1139) + Ubuntu 18.04 though WSL2) . It turns out that my wifi was configured in Windows as "public" network. Switching to "private" fixed the problem. Hope this can help Excellent @patrickhoebeke . This worked for me...!!

shiv-sid avatar Oct 31 '20 19:10 shiv-sid

Subscribing. Initially ping to Ubuntu mirrors worked, but apt update didn't (timeout). Then finally ping stopped working too (destination unreachable).

WSL rendered unusable. Pity. Back to Hyper-V VMs (with a custom NAT vSwitch to overcome spurious WiFi adapter issues). >sigh<

robpomeroy avatar Nov 09 '20 15:11 robpomeroy

Update: downgrading to WSL 1 seems to be the best option for now, while the WSL 2 bugs are ironed out? wsl --list --verbose

wsl --set-version [distro name] 1

robpomeroy avatar Nov 09 '20 16:11 robpomeroy

I did a downgrade installed stuff I needed upgraded back. But yeah WSL 2 seems to be broken for now.

Thadir avatar Nov 10 '20 18:11 Thadir

Same for me. For now I'm going back into my "normal" VM :/

trallnag avatar Nov 15 '20 12:11 trallnag

Same problem for me. I had to downgrade back to WSL 1...

mickael-h avatar Nov 22 '20 09:11 mickael-h

Same problem for me. Is there any workaround except downgrading back to WSL 1?

jacobbaek avatar Nov 24 '20 08:11 jacobbaek

Guys, check your firewall-settings. For me, Bitdefender Firewall blocks WSL2 traffic.

ad-on-is avatar Nov 24 '20 14:11 ad-on-is

@ad-on-is Thanks, I checked the firewall that i used at the desktop, this caused from firewall liked you mentioned. I thought it is strange why ICMP is working despite other all traffics are not working. but when i disabled the firewall policy, it is working and also checked the deny log in firewall log. Thanks again.

jacobbaek avatar Nov 25 '20 05:11 jacobbaek

i am living the same problem.... in wsl1 update is working , in wsl22 update problem.... any solution??????

osmanatam avatar Nov 25 '20 06:11 osmanatam

@osmanatam add two rules to your firewall that all through the network interface used by WSL2, it is worth a try.

https://github.com/microsoft/WSL/issues/4277#issuecomment-733021720

trallnag avatar Nov 25 '20 07:11 trallnag

Same problem for me

adam-grant-hendry avatar Nov 25 '20 16:11 adam-grant-hendry

Guys, check to firewall. WSL1 and WSL2 have different network interfaces. WSL1's network interfaces is that shared with host network, on the other hands WSL2 network interfaces has only one network intetface that works as NAT. So WSL1 can access where the host can access. But WSL2 can not access where the host can access.

jacobbaek avatar Nov 30 '20 12:11 jacobbaek