Pengwin
Pengwin copied to clipboard
python http server unreachable
Hi,
when I run python3 -m http.server I have Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/).
But If I open the http://0.0.0.0:8000/ or http://localhost:8000/ in the browser I have "connection failed" (below it's in Italian).

No problem to pinging it via shell. Could it be some win firewall setting? How to set it?

I'm using PENGWIN_VERSION="20.10.3"
WSL Version: 2
Locale: it_IT
Release Install Date: Wed Jun 3 16:19:27 CEST 2020
Branch: vb_release
Build: 19041
Full Build: 19041.1.amd64fre.vb_release.191206-1406
Display Scaling: 1
Windows Theme: light
Windows Uptime: 4d 3h 10m
WSL Uptime: 3d 1h 56m
WSL Release: Pengwin
WSL Kernel: Linux 4.19.104-microsoft-standard
Packages Count: 1021
Thank you
Hello @aborruso ,
Try to connect to the WSL2 IP instead of localhost. Run ip address to get your IP. Then use this IP in your browser.
Regards, Carlos
Hello @crramirez it works.
Do you have some tips to to automate it? Or do I must run everytime ip address to check my ip?
As usual thank you very much
I have seen some scripts out there. I can find one and make a how-to guide or even include it in pengwin-setup
It would be great, thank you
In .wslconfig there's enable localhost forwarding. I think this scenario is what's enabled by enabling it.
In
.wslconfigthere'senable localhost forwarding.I think this scenario is what's enabled by enabling it.
Do I must create .wslconfig file in ~ and add the below row?
enable localhost forwarding
You create it in your Windows home user. See the WSL release notes. There's a template you can copy/paste. Change this option to true
https://www.bleepingcomputer.com/news/microsoft/windows-10-wsl2-now-allows-you-to-configure-global-options/
localhostForwarding= # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true).
Default is true :/
I've tried with hint from https://github.com/microsoft/WSL/issues/6114 but without success.
I've lost this forwarding after upgrading to WSL2. I needed docker integration :/ Any other hints?
There's a WSL2 backend for Docker Desktop for Windows. If you enable that, do you still have an issue?
There's a WSL2 backend for Docker Desktop for Windows. If you enable that, do you still have an issue?
As you wrote it is for WSL 2. Upgrading Pengwin to 2 creates connectivity with host problem.
You have to enable it yourself. By default Docker uses Hyper-V/Moby VM.
hello, some advance on this?
hello, some advance on this?
Hello @DevDorrejo,
This discussion is quite long, so tell me what issue you are facing?
Regards, Carlos