12

I install python and start python -m SimpleHTTPServer in windows WSL. But the command netstat -an return an empty list. And of course i can't visit the url http://127.0.0.1:8000 in windows browser.

Furthermore, any commands which expose a port like ssh are not working.

Here is my windows version:

  • Windows 10 1703 15063.608

Here is the screenshots:

enter image description here

  • Might want to patch your system – Ramhound Sep 13 '17 at 22:36
  • @Ramhound sorry i don't understand :( Should i update my system to insider preview? – WalleZhang Sep 15 '17 at 1:10
  • No; You are missing the patch that was released on September 12th – Ramhound Sep 15 '17 at 6:04
  • @Ramhound The update histories show that last installed patch is KB4038788 was released on September 12th. But unfortunately it's still not work. Need I reinstall the WSL? – WalleZhang Sep 16 '17 at 14:16
  • If you have that patch installed then your build is 15063.608 not 15063.540 – Ramhound Sep 16 '17 at 19:34
5

It is a known issue that netstat does not currently work under WSL.

1

As OrangeDog link says, the netstat native linux does not work under WSL.

However in the GitHub comments there is a workaround (nice or ugly, I don't know): you can use the netstat.exe instead (I am also surprised that windows executables .exe runs on Linux).

Then in my WSL (v1) I was able to execute something like this:

netstat.exe -an | grep -i "listen" | grep -v "\[::\]" | grep 1616

A solution using the real native Linux executable would certainly be better but in the meantime this workaround does the job.

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.