Windows-Subsystem-for-Linux – Internet Access Not Working in Windows Subsystem for Linux

windowswindows 10windows-insiderwindows-subsystem-for-linux

I tried sudo apt-get update in the new Windows Subsystem for Linux, but I get the following error:

Error

The most relevant parts seem to be the "could not resolve" lines about Ubuntu servers, like:

Could not resolve 'archive.ubuntu.com'

Best Answer

There is an open GitHub issue about this error.

It appears that the most likely problem is that /etc/resolv.conf didn't get generated correctly. Make sure it contains a nameserver line for a valid DNS server, preferably one on your local network. Many routers provide DNS services to their networks; on my network, I would add this line:

nameserver 192.168.1.1

If there are entries that don't correspond to valid DNS servers, remove them.

If you use a third-party antivirus product, try disabling its firewall - there are reports that some such programs interfere with Bash's connectivity.