Pengwin
Pengwin copied to clipboard
Unable to bind to localhost or 0.0.0.0
Windows Version: 18995 (Insider release)
In the simplest case, I expect sudo nc -l 80 to bind to localhost:80
Visiting http://localhost in any browser should yield something like:
GET / HTTP/1.1 Host: localhost User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Connection: keep-alive Upgrade-Insecure-Requests: 1
The above is the result of running the same command on a fresh Ubuntu install from Microsoft's App Store and then connecting to http://localhost in Firefox.
Things I've tried
- Test in Ubuntu WSL1 and WSL2 - both succeeded
- I tried reseting the firewall to defaults, rise and repeat. Again, Ubuntu succeeds, Pengwin fails to properly bind
- Repairing Pengwin
- Reseting Pengwin
- Building from source (using the prebuilt amd64 tarball)
- Using the official Pengwin app from the Microsoft store
- Running
sfc /scannowandDISM /Online /Cleanup-Image /RestoreHealth - Disabling the firewall entirely
There may be an upstream issue with debian(?) as I tried this on the Debian distro from the Microsoft Store and it didn't work for WSL1 and WSL2.
sudo nc localhost 80 bounce on both Pengwin and Debian with localhost [127.0.0.1] 80 (http) : Connection refused
Ok, thank you for reporting we will reproduce this
Just a follow up, I ran into https://github.com/microsoft/WSL/issues/4566 which I fixed by running an in place upgrade with an 18995 iso. That issue seems to be independent of this. I can't say for certain when binding in Pengwin stopped working - I hadn't a reason to use it until recently.
Bump this fails for me using the same command sudo nc -l 8000
I fixed it with workaround here, but I think MS is working on a further fix
Excellent thanks for sharing!