I started playing around with the Windows 10 Anniversary edition Bash shell in build 14316, and one of the first problems I ran into was that network connectivity wasn't working. Any network command – curl, apt-get etc. just hangs.
IPv6 DNS Addresses not Working
When you install the Ubuntu subsystem (from Windows Features), the system settings from Windows are copied into the resolve.conf file, so it inherits the current Windows settings, which should be fine since that clearly works in Windows. But alas, in the Ubuntu Bash shell I get no connectivity.
It appears the problem is that the Ubuntu subsystem doesn't deal properly with IPv6 IP Addresses that are listed by default in the network resolution file. The IPv6 addresses are first in the list and apparently that doesn't work. The simple fix, is to swap the the IPv4 and IPv6 addresses and – voila, network access works.
This is likely a temporary problem but definitely an issue in the current 15316 build of Windows 10 IP that I'm running.
Edit your resolv.config
To fix you can bring up an editor like this:
nano /etc/resolv.conf
My original file looked like this:
Notice the IPv6 address at the top of the nameservers list.
Moving the IPv6 servers below (Ctrl-K to copy Ctrl-U to paste single line):
Save with Ctrl-O, and you're off to the races – Internet Connectivity is back. curl and apt-get, which is what I needed to use earlier, now works.
Accessing the File System from Windows
If editing text through a screen based editor feels a bit quaint as it does to me, you can also access the Linux file system from Windows and Explorer so you can use your favorite editor to interact with the file system.
The location of the subsystem is at:
C:\Users\<username>\AppData\Local\lxss\rootfs
From there you can dig directly into the file system and look at files.
You can easily edit files from the Linux file system. Keep in mind that standard Unix file forwarding and links aren't going to work when you use the Windows shell for editing. In the file edit above the forward didn't work automatically and I had to follow the link to open the file on the right.
Other Network Problems
There are a still some things that don't work.
I still can't run ifconfig which gives me:
root@localhost:~# ifconfig
Warning: cannot open /proc/net/dev (No such file or directory). Limited output.
Not sure what's causing this and searching around for this doesn't bring up anything useful other than installation errors for a distro (not specific to this Windows shell).
Likewise some commands continue to not work. ping also fails:
root@localhost:~# ping west-wind.com
ping: icmp open socket: Socket type not supported
There's a long thread on a GitHub issue around all of these problems with no resolution yet with the exception of the main connectivity issue. But I suspect these are just early version blues – this stuff will get sorted out. For the moment, I have enough connectivity to get stuff done.
Other Posts you might also like