-
Notifications
You must be signed in to change notification settings - Fork 814
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
Cannot access Windows network port from WSL2 using virtual IP #5338
Comments
I also facing similar issues where as sometimes port open from wsl2 accessible from windows host and sometimes not.. Didn't able to get actual reason anywhere... I have all things at latest version on todays date.... |
Is there any update on this at all? Currently i did exactly as described above
Did you ever get this to work? |
No, I did not get this to work, still using WSL1 at the moment |
I thought I can use this, but finally end up in dual booting my system as always! |
You're probably being blocked by the Windows firewall as Ethernet is a "Public" network. check out this answer on https://superuser.com/a/1496354 |
I adden an inbound rule for my test port (8000 in my case) that should apply for all interfaces and for all types of networks (so including I also don't see dropped connections logged by the Windows firewall. |
This is still an issue as to this day. I tried every possible workaround... The big problem is that this is preventing many people from migrating from Docker for Windows to Podman running inside Linux on WSL 2, as they cant test the services in the containers against an application server running on Windows (which you usually do when developing said server). Downgrading to WSL 1 is also not an option as this causes issues with Podmans File system drivers |
You need to allow inbound connection in Windows Firewall for that program which wants to connect with WSL2 side. |
Allowed inbound connection in firewall and no luck |
still open after two years and no response from Microsoft ... what a shame but i found a workaround for this on Windows 10 using Internet Connection Sharing:
it's wired the chosen WSL disappear after restart in step 1's properties dialog, but seems have no impact. NOTE: turn off windows defender firewall when testing |
well...I also faced this issue today... |
Microsoft, fack you. |
i'm facing this issue too and it's feel so bad |
Windows was sht, is sht, always will be sh*t |
Tried that, still no luck. This issue still persists. |
Hi. Can you please collect networking logs by following the instructions below? |
I was finally able to connect from a docker container on WSL2 to Windows 10 host. (Docker -> WSL2 -> Windows 10). Here is some insight about how I did it:
I changed it to something like this:
And it worked. It might not applicable in your case but in the end I was able to receive connections from my WSL2 ubuntu instance towards Windows 10 host. P.S.: I also put the docker container network mode to "host". Meaning it was not in its own sub "docker network". |
Environment
Steps to reproduce
I just installed a fresh Ubuntu 20.04 LTS on WSL2 for creating this ticket (I experienced the same problem with my Debian on WSL2, so I downgraded that one back to WSL1 as I needed the functionality).
Make sure to have a webserver running on Windows, and you cannot access it with the IP from
/etc/resolv.conf
in WSL2, even through that should work according to the docs.In this case, I created a simply NodeJS server on port
8080
, which is listening on0.0.0.0
. It is accessible from the entire LAN on192.168.1.24
(local IP).Now, if you want to access it from WSL2, using the nameserver (
172.21.48.1
here, or virtual IP) as suggested in the article, it unfortunately does not respond at all. Usinglocalhost
doesn't work either (as expected), but using the direct IP address does work.Below is a screenshot of my test: top-left is the WSL2 Ubuntu, top-right is Powershell on Windows running the actual server. De two browser windows on the bottom are run on the host machine, demonstrating the webserver responds to both localhost and the external IP (external IP access was also tested from another machine on the LAN, that works fine).
Expected behavior
I would expect to either
/etc/resolv.conf
(but that breaks DNS resolving at this time)The latter would be useful for scripting.
Actual behavior
Well, it isn't working as I would have hoped😄
P.S. While working on this, I also managed to break DNS resolving completely. This was probably related to me resetting the Windows firewall (for testing), as it was fixed after rebooting.
The text was updated successfully, but these errors were encountered: