-
Notifications
You must be signed in to change notification settings - Fork 822
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
WSL2: Unable to access Docker(in wsl2) on host #11096
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:
|
Can you post your .wslconfig and collect /logs? The log collection only needs to run while you start wsl -> start docker -> attempt to connect -> and then stop the container. |
I have the same problem. The follow is my testing process.
When I start a docker container on debian as following
I can access the redis service from debian and ubuntu via However, When I start a docker container on debian with options
Then I can access the redis service from debian, ubuntu and also windows via Docker version is in the following
But if I just listen a port on debian, for example I dont know is it a bug from wsl2 or docker, or maybe is it a feature? Hope for response~ |
I have soved the problem.
And then add the following to
|
@SethWen: Your above solution for the .json config worked for me (I only needed the |
This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue. Thank you! |
if set "iptables": false, containers cannot be accessed through docker internal networks. It's not a perfect way |
Windows Version
Microsofe Windows[Version 10.0.22621.3007]
WSL Version
2.0.9.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.133.1-1
Distro Version
Ubuntu-22.04
Other Software
Repro Steps
step up a container:
docker run -d --name nginx01 -p 3344:80 nginx
Expected Behavior
Under normal circumstances, I can access nginx by:
http://localhost:3344
Actual Behavior
I can get the respon in WSL2: curl localhost:3344, but I can not get the respon by any other IP addresses or ports. I want to access the nginx in chrome browser, but it does not work in chrome browser by(of course I can not get respon in command line in windows):
Diagnostic Logs
My specifications:
I have checked the google and github issues but does not help. Reinstalling WSL2 and closing both WSL2 and Windows Firewall are not useful.
PS: I install VMware first, and then use wsl2. Maybe there is some conflict. What should I do to access nginx in Windows chrome? I think this is a network configuration issue.
The text was updated successfully, but these errors were encountered: