2

When I try using the command "ifconfig" on Bash on Ubuntu on Windows(WSL), it gives me an error like this :-

root@example:~# ifconfig
Warning: cannot open /proc/net/dev (No such file or directory). Limited output.

And when I try to run "iwconfig" :-

eth0   no wireless extensions.

wifi0   no wireless extensions.

lo       no wireless extensions.

und0  no wireless extensions.

und1  no wireless extensions.

This leads me to believe that it hasn't detected the network devices, but then how is the internet working? Internet works well, as I've used apt-get to install apps;

I'm no linux pro, let alone a wsl pro, so could I have a some advice on how to overcome this problem?

  • The Bash implementation on Windows is not fully featured, and many networking related parts of the kernel are not currently implemented. – Mark Riddell Sep 4 '16 at 10:42
  • @MarkoPolo Have to agree with that, that's why its still a beta feature. – Don't Root here plz... Sep 4 '16 at 13:04
3

WSL doesn't run a full Linux kernel – it only translates each individual syscall to its Windows variant. Therefore WSL doesn't need to "detect" devices the same way real Linux would, because Windows itself has already done that.

Besides, "detecting" a device is not the same thing as exposing information about it, anyway. The files in /proc/net are only for informative purposes; they are not needed for actually using the net. So it's not a big problem if they are missing.

In addition, most network programs do not care about the actual devices; they only deal with high-level functions (BSD sockets) and let the OS handle the details. Therefore, as long as WSL implements functions like socket() and connect() and sendto(), that's enough.


The situation with iwconfig is similar: the wireless devices are already managed by Windows itself; WSL just doesn't know how to translate the link information to Linux programs, but most of them do not need to know that anyway.

Besides, iwconfig is an old tool that uses the nearly-obsolete WEXT API. I suspect the developers would care more about making modern nl80211-based tools such as iw work first.

(Even many Linux drivers no longer support WEXT directly – they only emulate it on top of nl80211.)

  • Hmmm, I see. How do I do stuff like advanced network monitoring if WSL doesn't even detect the network connections/adapters? I've upvoted, but let me see if anyone else answers before accepting. – Don't Root here plz... Sep 4 '16 at 13:17
  • Either use native Windows programs (want tcpdump? use Wireshark) or wait until Microsoft improves the WSL subsystem (e.g. see issue 66, issue 239). – grawity Sep 4 '16 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.