Skip to content
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 cannot access host machine #10316

Closed
1 of 2 tasks
pzq-loves-qwq opened this issue Jul 21, 2023 · 2 comments
Closed
1 of 2 tasks

WSL2 cannot access host machine #10316

pzq-loves-qwq opened this issue Jul 21, 2023 · 2 comments

Comments

@pzq-loves-qwq
Copy link

Windows Version

Microsoft Windows [Version 10.0.19045.3208]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

On the host machine, open an HTTP server via python3 -m http.server. (Any application that opens an HTTP server works. )

In WSL, run cat /etc/resolv.conf to get the IP address of the host machine. (I got 172.21.144.1. )

On the host machine, in a new powershell, run curl http://localhost:8000 and curl http://172.21.144.1:8000. Both commands work fine and print a response.

In WSL, run curl http://cn.bing.com and curl http://172.21.144.1:8000.

Expected Behavior

Both commands run in WSL print the corresponding responses.

Actual Behavior

Only the first command (requesting cn.bing.com) runs fine. The second (requesting the host machine) does not. This means WSL can access the Internet but not the host machine (through the IP in /etc/resolv.conf).

Diagnostic Logs

No response

@OneBlue
Copy link
Collaborator

OneBlue commented Jul 25, 2023

Thank you @pzq-loves-qwq. Relaying from WSL to the host is not supported at the moment so the output you're seeing is the expected behavior.

@OneBlue OneBlue closed this as completed Jul 25, 2023
@spyro2000
Copy link

spyro2000 commented Nov 6, 2023

Relaying from WSL to the host is not supported at the moment

WTF...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants