-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL mirrored network Docker container cannot access Windows service #10926
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Open similar issues:
Closed similar issues:
|
Same problem! |
1 similar comment
Same problem! |
Temporary solution:
Proxy 7890 to 7891, use ip:7891 within docker. |
Can you describe it more specifically? |
The |
Of course......I try lots of ips, such as 127.0.0.1, 192.168.xxx, 172.xxx, none of them work. |
Check that
|
Yes, I ensure that this is set. |
It doesn't work for me either.
❯ sudo iptables -t nat -L --line-numbers
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination
1 DOCKER all -- anywhere anywhere ADDRTYPE match dst-type LOCAL
2 DNAT tcp -- anywhere anywhere tcp dpt:7891 to:192.168.10.1:7890
Chain INPUT (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
1 DOCKER all -- anywhere !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination
1 MASQUERADE all -- 172.17.0.0/16 anywhere
Chain DOCKER (2 references)
num target prot opt source destination
1 RETURN all -- anywhere anywhere
❯ sudo sysctl --system | grep ip_forward
net.ipv4.ip_forward = 1
❯ docker run -it --rm mydebian:11 curl -I -svo /dev/null -x http://192.168.10.1:7891 https://www.google.com
* Trying 192.168.10.1:7891...
* connect to 192.168.10.1 port 7891 failed: Connection refused
* Failed to connect to 192.168.10.1 port 7891: Connection refused
* Closing connection 0 |
Hi. Can you please collect networking logs by following the instructions below? |
|
Same problem |
The docs cloud resolve accessing Windows from WSL, but does not resolve accessing Windows from Docker containers within WSL |
There doesn't seem different between docker in wsl and using docker desktop with a wsl backend? I think you need to be sure of a couple things:
|
@zhangzhao219 @hzhq1255 Check that the docker daemon configuration disables iptables. Maybe another port forwarding program is needed. |
FWIW Docker Desktop now still have issue accessing proxy port on docker host when http proxy is configured manually, no matter proxy IP is set to 127.0.0.1 or any IP of a local network adapter. But when you disable Manual proxy configuration, Docker Desktop will use Windows proxy settings and automatically do the magic to make it work. |
Windows Version
Microsoft Windows [版本 10.0.22631.2861]
WSL Version
2.0.14.0
Are you using WSL 1 or WSL 2?
Kernel Version
Linux version 5.15.133.1-microsoft-standard-WSL2
Distro Version
Arch Linux
Other Software
No response
Repro Steps
1.Instead of using docker desktop, I used the docker ce
if network mode is nat, I can use default switch gateway ip to access windows services.
Run container with host network , it can access the windows proxy service.
I have also tried the nginx service running on windows , the container also cannot access the service.
Is there a solution for containers to access windows services even in bridge mode?
Expected Behavior
Actual Behavior
Diagnostic Logs
WslLogs-2023-12-16_13-38-31.zip
The text was updated successfully, but these errors were encountered: