Linux Subsystem for Windows cannot access the Internet

For some reason my Bash on Ubuntu on Windows is unable to access the Internet.

I.e. when I do

sudo apt-get update

I get a bunch of failed fetches. Exactly as the issue describe under this link.

I have tried all of the suggest solutions, but none of them seems to work.

Things that I have tried:

  • adding 8.8.8.8 to /etc/resolv.conf,
  • adding my default gateway to /etc/resolv.conf,
  • disabling IPv6,
  • running in Administrative Mode,
  • uninstalling and reinstalling Bash,
  • disabling my antivirus.

Here is what my resolv.conf looks like:

#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888

Solution 1:

Assuming that by "disabling my antivirus* you mean disabling my antivirus/firewall, beware that disabling the firewall is not always sufficient depending on the one you use. The current (unsatisfactory) workaround is to uninstall the firewall.

This and other recommendations can be found in the following post from the Linux Subsystem for Windows developers:

Source: https://github.com/Microsoft/BashOnWindows/issues/5

It has been very helpful to see experience with various firewalls. We are very aware of the issues and are looking into it. Unfortunately, this is something that will probably take some time. We did release WSL as a beta knowing that there would be some issues and are working hard to address things.

Here's the state of the world as I know it when it comes to firewalls / no network:

Outbound Traffic

Kaspersky: Needs to be uninstalled for internet access in WSL

Avast: Needs to be uninstalled for internet access in WSL

Bitdefender: Firewall must be disabled to get internet access in WSL.

AVG: Looks like they have done some work in AVG 2016 (learned this on thread #475). Not certain what they have done, but it is interesting to note.

Windows Firewall: Must have unchecked "Outbound rules that do not match a rule are denied"

Inbound Traffic

Still looking into this one. Using WSL as a server was not one of our core priorities for the Anniversary Update. It is something we want to support in the future.

Ping

Ping must be run with Windows Administrator privileges We are doing a little more due diligence before reaching out to the firewall providers. I will also update the FAQ with more information when found (have a very bare bones placeholder there now).