You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support accessing Podman services from Windows LAN #19890
Is your enhancement related to a problem? Please describe
When running Podman Desktop on Windows, containers running in the Podman machine are accessible from the Windows host from localhost. However, because of how WSL2 works (see details), those services are not accessible when using the PC domain name or IP address (e.g. ..local).
Windows requires to run the CLI netsh interface portproxy for each port we want to access via PC domain name or IP address.
The forward needs to be towards the WSL2 IP address, which is dynamic and changes on each reboot. So every time a Windows machine is started, before being able to consume Podman service, the Windows proxy need to be reconfigured.
Describe the solution you'd like
I would like Podman Desktop to transparently take care of setting up the proxy in Windows to allow accessing Podman containers from the PC domain name or IP address. That's something that Docker Desktop does.
Describe alternatives you've considered
No real alternative here. Would it be possible to implement a Podman exception that intercepts container events and configures the proxy dynamically?
Additional context
No response
Reacted by 历知辛, Arend von Reinersdorff, Nick Vosseteig, Dominik Seweryn, cyqsimon, Nico Fränzel, hellkrusher, Brian R. Becker, hsz-sr, Denis Savenko and 2 more
@jeffmaury Thanks for your comment. I tried with a Podman machine configured with user networking, but the result was the same. Calling <machine-name>.<domain-group>.local:8080 or <machine-ip>:8080 doesn't work from the Windows host, but localhost:8080 does.
Currently, even when using user-mode networking, port forwarding is still done by the WSL port mirroring. We could explore disabling WSL port mirroring, and handling this in gvproxy when user-mode is enabled, which would result in the bind being on the Windows host. However, I think the feature request as suggested is also a good idea to support port proxy registration.
@ThomasVitale as a workaround you could do a script in a startup task that establishes this on login, is that what you are currently doing?
@n1hility thanks for your answer. It would be great if Podman could do that out of the box!
The workaround I'm investigating right now is a PowerShell script scheduled to run at PC startup (for example, using the Windows Task Scheduler). The script would clear the previous proxy configuration (netsh interface portproxy reset) and add new forward rules. So far, I haven't found any way to do that on a range of ports, meaning that you need to know which ports the containers will expose in advance and run a command for each of them (e.g. netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=8080 connectaddress=<wsl-ip>).
@rhatdan I'm definitely available to help with this issue. I'm not very familiar with this specific area, but if I can get some guidance and support, I'm available to give it a try.
@ThomasVitale FYI there is a new feature in WSL called mirrored mode networking that is in preview builds that we are likely to take advantage (perhaps requiring) once it hits stable. In addition to providing a capability like our user-mode networking feature, it also supports exposing ports to the outside world, since it mirrors network interfaces. I mention this in case you prefer to wait on that.
By any chance, did anyone found a solution :) ? We were exploring the idea to use podman on our VMs instead of Docker-compose but we are blocked here, cannot expose our services outside the VMs :(
@n1hility I had missed your message, sorry. Thanks a lot for the info, that looks really promising! I haven't had much luck with my experiments trying to use the windows proxy (beyond hacky scripts). I'll try investigating if the new mirrored mode in WSL2 solves the issue for Podman. I'll write here my findings as soon as I get to try that out.
@lbouriez the only workaround I found is explicitly configuring the proxy via the netsh interface portproxy as described here: #19890 (comment)
@n1hility I had missed your message, sorry. Thanks a lot for the info, that looks really promising! I haven't had much luck with my experiments trying to use the windows proxy (beyond hacky scripts). I'll try investigating if the new mirrored mode in WSL2 solves the issue for Podman. I'll write here my findings as soon as I get to try that out.
@lbouriez the only workaround I found is explicitly configuring the proxy via the netsh interface portproxy as described here: #19890 (comment)
One important point for the portproxy command: Make sure that one (!) IP is provided in the command. In my case, multiple network interfaces are present in the Podman WSL2 machine.
Having multiple IP causes an issue when relying on the Microsoft documentation examples that instruct to use $(wsl hostname -I) like in this sample to expose port 8000 for Paperless-ngx:
This causes also the aforementioned issue that services are only exposed to localhost instead of all IP for the Windows LAN. Rather use in Powershell with administrator rights:
I investigated different combinations and configurations, but I ran out of options. Does anyone have more ideas to make this work?
Podman: 5.4.0
Podman Desktop: 1.16.2
Windows 11
Given a container exposing port 8080, this is what I get.
When Using Docker Desktop
From the Windows host:
✅ localhost:8080
✅ <machine-name>:8080
✅ <machine-name>.<domain-group>.local:8080
From my default WSL2 instance:
✅ localhost:8080
✅ <machine-name>:8080
✅ <machine-name>.<domain-group>.local:8080
From the LAN:
✅ <machine-name>.<domain-group>.local:8080
When Using Podman (WSL2 NAT Mode) with Podman Desktop
From the Windows host:
✅ localhost:8080
❌ <machine-name>:8080
❌ <machine-name>.<domain-group>.local:8080
From my default WSL2 instance:
✅ localhost:8080
✅ <machine-name>:8080
❌ <machine-name>.<domain-group>.local:8080
From the LAN:
❌ <machine-name>.<domain-group>.local:8080
When Using Podman (WSL2 Mirror Mode) with Podman Desktop
From the Windows host:
✅ localhost:8080
❌ <machine-name>:8080
❌ <machine-name>.<domain-group>.local:8080
From my default WSL2 instance:
❌ localhost:8080
❌ <machine-name>:8080
✅ <machine-name>.<domain-group>.local:8080
From the LAN:
❌ <machine-name>.<domain-group>.local:8080
The only way to obtain the same behavior as Docker Desktop is configuring explicit proxy rules every time the PC is started (because the WSL2 IP address can change). And a rule is needed for each port number you might expose from a container.
Reacted by Beacon Zhang, Raniere Silva, JanKap, cyqsimon, ACertainCoder, Nico Fränzel, Hafidz, PakornV, desavenk-oracle and Denis Savenko
Another option on Windows Server is to use IIS as a front to the WSL distribution (and thus, containers). I was able to use an IIS Reverse Proxy (pointing to 127.0.0.1:8080) as a workaround. Then, accessing <machine-name> from the local network worked without issue (no port number).
I did not test this with specific port numbers on the IIS side, but at least it's something!
Also, as @ThomasVitale mentions in their comment, when on Podman on WSL2 in Mirrored networking mode, Podman containers' exposed ports are not accessible from inside WSL2 on loopback interface (localhost, 127.0.0.1). And this issue cannot be addressed by netsh interface portproxy solution.
Tools like socat cannot be used either, because the port appears to be listening, however, it is not possible to connect to the service using its port on WSL2's internal loopback interface. Connecting on real interfaces IP addresses is however possible (which is very inconvenient due to dynamic nature of real IP addresses in many cases).
From inside WSL2:
# ✅the port listens on all interfaces
netstat -tulnp | grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 48514/conmon
# ❌forwarding with socat is not possible due to port business
socat TCP-LISTEN:8080,bind=127.0.0.1,reuseaddr,fork TCP:$(hostname -I | awk '{print $1}'):8080
2025/12/07 19:01:55 socat[49841] E bind(5, {AF=2 127.0.0.1:8080}, 16): Address already in use
# ❌connection using loopback interface is not possible (from inside WSL2 in Mirrored networking mode)
nc -w 5 -v 127.0.0.1 8080
Ncat: Version 7.92 ( https://nmap.org/ncat )
Ncat: TIMEOUT.
# ✅connection using real interface IP is possible (but inconvenient)
nc -w 5 -v $(hostname -I | awk '{print $1}') 8080
Ncat: Version 7.92 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.250.153:8080.
^C
Created a cross-issue in WSL GitHub repo regarding the same problem of unreachable Podman containers' exposed ports on loopback interface on mirrored WSL network mode: microsoft/WSL#13868
Activity
jeffmaury commentedon Sep 7, 2023
Looks like a Podman upstream issue. Did you try with the latest user networking mode ?
mheon commentedon Sep 7, 2023
@n1hility PTAL
ThomasVitale commentedon Sep 8, 2023
@jeffmaury Thanks for your comment. I tried with a Podman machine configured with user networking, but the result was the same. Calling
<machine-name>.<domain-group>.local:8080or<machine-ip>:8080doesn't work from the Windows host, butlocalhost:8080does.n1hility commentedon Sep 8, 2023
Currently, even when using user-mode networking, port forwarding is still done by the WSL port mirroring. We could explore disabling WSL port mirroring, and handling this in gvproxy when user-mode is enabled, which would result in the bind being on the Windows host. However, I think the feature request as suggested is also a good idea to support port proxy registration.
@ThomasVitale as a workaround you could do a script in a startup task that establishes this on login, is that what you are currently doing?
ThomasVitale commentedon Sep 8, 2023
@n1hility thanks for your answer. It would be great if Podman could do that out of the box!
The workaround I'm investigating right now is a PowerShell script scheduled to run at PC startup (for example, using the Windows Task Scheduler). The script would clear the previous proxy configuration (
netsh interface portproxy reset) and add new forward rules. So far, I haven't found any way to do that on a range of ports, meaning that you need to know which ports the containers will expose in advance and run a command for each of them (e.g.netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=8080 connectaddress=<wsl-ip>).github-actions commentedon Oct 9, 2023
A friendly reminder that this issue had no activity for 30 days.
ThomasVitale commentedon Oct 19, 2023
Can we remove the stale status from this issue and keep it open?
rhatdan commentedon Oct 19, 2023
@ThomasVitale is this something you can work on?
ThomasVitale commentedon Oct 28, 2023
@rhatdan I'm definitely available to help with this issue. I'm not very familiar with this specific area, but if I can get some guidance and support, I'm available to give it a try.
rhatdan commentedon Oct 28, 2023
Go for it.
n1hility commentedon Nov 1, 2023
@ThomasVitale FYI there is a new feature in WSL called mirrored mode networking that is in preview builds that we are likely to take advantage (perhaps requiring) once it hits stable. In addition to providing a capability like our user-mode networking feature, it also supports exposing ports to the outside world, since it mirrors network interfaces. I mention this in case you prefer to wait on that.
lbouriez commentedon Jan 26, 2024
By any chance, did anyone found a solution :) ? We were exploring the idea to use podman on our VMs instead of Docker-compose but we are blocked here, cannot expose our services outside the VMs :(
ThomasVitale commentedon Jan 26, 2024
@n1hility I had missed your message, sorry. Thanks a lot for the info, that looks really promising! I haven't had much luck with my experiments trying to use the windows proxy (beyond hacky scripts). I'll try investigating if the new mirrored mode in WSL2 solves the issue for Podman. I'll write here my findings as soon as I get to try that out.
@lbouriez the only workaround I found is explicitly configuring the proxy via the
netsh interface portproxyas described here: #19890 (comment)marco4net commentedon Jun 23, 2024
One important point for the portproxy command: Make sure that one (!) IP is provided in the command. In my case, multiple network interfaces are present in the Podman WSL2 machine.
Having multiple IP causes an issue when relying on the Microsoft documentation examples that instruct to use
$(wsl hostname -I)like in this sample to expose port 8000 for Paperless-ngx:netsh interface portproxy add v4tov4 listenport=8000 listenaddress=0.0.0.0 connectport=8000 connectaddress=$(wsl hostname -I)This causes also the aforementioned issue that services are only exposed to localhost instead of all IP for the Windows LAN. Rather use in Powershell with administrator rights:
$wslIP = $(wsl hostname -I).Split(" ")[0];netsh interface portproxy add v4tov4 listenport=8000 listenaddress=0.0.0.0 connectport=8000 connectaddress=$wslIPThomasVitale commentedon Feb 18, 2025
I investigated different combinations and configurations, but I ran out of options. Does anyone have more ideas to make this work?
Podman: 5.4.0
Podman Desktop: 1.16.2
Windows 11
Given a container exposing port 8080, this is what I get.
When Using Docker Desktop
From the Windows host:
localhost:8080<machine-name>:8080<machine-name>.<domain-group>.local:8080From my default WSL2 instance:
localhost:8080<machine-name>:8080<machine-name>.<domain-group>.local:8080From the LAN:
<machine-name>.<domain-group>.local:8080When Using Podman (WSL2 NAT Mode) with Podman Desktop
From the Windows host:
localhost:8080<machine-name>:8080<machine-name>.<domain-group>.local:8080From my default WSL2 instance:
localhost:8080<machine-name>:8080<machine-name>.<domain-group>.local:8080From the LAN:
<machine-name>.<domain-group>.local:8080When Using Podman (WSL2 Mirror Mode) with Podman Desktop
From the Windows host:
localhost:8080<machine-name>:8080<machine-name>.<domain-group>.local:8080From my default WSL2 instance:
localhost:8080<machine-name>:8080<machine-name>.<domain-group>.local:8080From the LAN:
<machine-name>.<domain-group>.local:8080The only way to obtain the same behavior as Docker Desktop is configuring explicit proxy rules every time the PC is started (because the WSL2 IP address can change). And a rule is needed for each port number you might expose from a container.
troy-work commentedon Jul 7, 2025
[Above] @marco4net solution works for me.
mfrangakis commentedon Sep 18, 2025
Another option on Windows Server is to use IIS as a front to the WSL distribution (and thus, containers). I was able to use an IIS Reverse Proxy (pointing to
127.0.0.1:8080) as a workaround. Then, accessing<machine-name>from the local network worked without issue (no port number).I did not test this with specific port numbers on the IIS side, but at least it's something!
whatsupbros commentedon Dec 7, 2025
Also, as @ThomasVitale mentions in their comment, when on Podman on WSL2 in Mirrored networking mode, Podman containers' exposed ports are not accessible from inside WSL2 on loopback interface (localhost, 127.0.0.1). And this issue cannot be addressed by
netsh interface portproxysolution.Tools like
socatcannot be used either, because the port appears to be listening, however, it is not possible to connect to the service using its port on WSL2's internal loopback interface. Connecting on real interfaces IP addresses is however possible (which is very inconvenient due to dynamic nature of real IP addresses in many cases).From inside WSL2:
From Windows host powershell:
whatsupbros commentedon Dec 11, 2025
Created a cross-issue in WSL GitHub repo regarding the same problem of unreachable Podman containers' exposed ports on loopback interface on mirrored WSL network mode: microsoft/WSL#13868