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

Unable to access windows localhost from WSL2 #4935

Closed
Ju-ch opened this issue Feb 27, 2020 · 6 comments
Closed

Unable to access windows localhost from WSL2 #4935

Ju-ch opened this issue Feb 27, 2020 · 6 comments

Comments

@Ju-ch
Copy link

Ju-ch commented Feb 27, 2020

As I said in the title, when I tried to use the windows localhost data in wsl2, I could neither obtain it through 127.0.0.1, nor access it according to the nameserver in cat /etc/resolv.conf.

image.png

My windows system version : 19041.84
WSL2 : Ubuntu

@therealkenc
Copy link
Collaborator

/dupe #4619

@ghost
Copy link

ghost commented Feb 27, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@ghost ghost closed this as completed Feb 27, 2020
@ghost ghost added the duplicate label Feb 27, 2020
@therealkenc
Copy link
Collaborator

nor access it according to the nameserver in cat /etc/resolv.conf

You have a 'nor' in there that doesn't match the title.

Two things. Make sure the Windows server is listening on the right addresses; listening on 0.0.0.0 being the easy win (ref #4907). The IP address you want to use for the client is the one marked "(Preferred)" in win32 ipconfig /all. It isn't clear the resolve.conf guidance being given works in all setups.

@Ju-ch
Copy link
Author

Ju-ch commented Feb 28, 2020

Two things. Make sure the Windows server is listening on the right addresses; listening on 0.0.0.0 being the easy win (ref #4907). The IP address you want to use for the client is the one marked "(Preferred)" in win32 ipconfig /all. It isn't clear the resolve.conf guidance being given works in all setups.

Thx, your answer helped me, and it also resolved my doubts.

Thanks again

@iongion
Copy link

iongion commented Jun 18, 2020

I still have it in Insider build 19645

  • above is a msys shell in windows native
  • under is wsl2 shell

image

  • Windows firewall is down
  • Postgress is set to allow connections from everywhere host all all 0.0.0.0/0 md5

@iongion
Copy link

iongion commented Jun 18, 2020

To answer to my own post - it does not work like this, wsl2 needs the ip of the adapter not localhost :(

... see here https://superuser.com/questions/1536619/connect-to-mysql-from-wsl2

This one from the ipconfig list

image

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

No branches or pull requests

3 participants