-
Notifications
You must be signed in to change notification settings - Fork 847
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 ping host machine #4171
Comments
We’ve labelled your issue as ‘need-repro’ since we need more steps to help identify your problem. Could you please provide us with reproducible steps for the issue you’re experiencing, including things such as the specific command line steps necessary to reproduce the behavior and their output. Thank you! -The WSL Team |
Same issue. I'm running Windows 10.0.18932.1000 + WSL 2 with Debian. The exact commands:
I am able to ping google.com/external sites in general - just not the host machine. |
I can't ping anything. I think this problem is caused by wrong mask in ip address and wrong routing table after upgrade to WSL 2. |
Version 10.0.18995.1 I can ping 8.8.8.8, www.google.com, 192.168.0.1, 192.168.0.100(Raspberry Pi). I tried "Reset Network" but did not improve anything. |
In WSL2, I was able to access the web server started on Windows side using w3m with IP address specification (192.168.0.90), but I could not connect to VcXsrv. |
@mikuta0407 make sure to disable access control when starting up your X server, this will allow it to accept external connections and will likely resolve your 'Connection refused' error. |
same here, "Reset Network" didn't help. |
It works for me , thanks @BBJip |
all you need to do is change your windows firewall settings,and allow hyper-v access |
@h34rtb34t Did you connect to the HTB VPN from your windows host or from your Kali distro? |
Hi there, thanks very much for answering back. I've tried both, I mean either way it just won't work.
I first tried connecting to the VPN via windows machine, then within Kali wsl and the result is the same. I tried to play with routing tables(according to what is out there on Google that other have tried) ; I went through un installing and re-installing kali wsl multiple times; tried different scripts to reset the wsl2 networking settings etc etc.... And just could not do it. At the moment I'm working on a Kali Docker container and after few initial settings I get things done here within Docker. I really would like to have the chance switch back to my kali wsl2 and keep rolling from there. It is really strange and 'weird' I could not come across a similar issue to mine. As I said I keep searching on forums etc etc and still trying to get it working, but still I'm not able to use my Kali wsl.
If there is any info you could provide me or at least point i the right direction that would be GREAT.
Thanks a lot
|
After trying all the methods above, what worked for me was uncheck "Block all connections, including those in the list of allowed apps" under Public Network Firewall setting (screenshot attached). If you are tying ping, make sure your ICMP port is allowed in the firewall or follow the steps by @johnnyP4 I understand this can be considered not a "security best practice" as you are allowing incoming connections to apps on public network but this issues was fixed for me after doing so. |
thank you @chaoszh |
Thanks @skumarlabs. This is definitely something can be easily missed. Seems for some newly installed Windows 10, it would be default enable "Block all incoming connections, including those in the list of allowed apps". |
The firewall settings were disabled by default and I followed the above configuration. It did not work for me, I had to also remove the
See for more info: #5109 (comment) |
Thank you @chaoszh , you saved my day! |
If anyone bumps into this issue - one more thing to check is disable VPN connection on the host machine (if any) |
For the record, WSL is considered 'PUBLIC' from windows guys (I haven't figured out why). That means if you just try to simply disable the firewall of the your current profile (which in my case 'Private') to check if it's a firewall issue, that's not gonna work. |
Thank you to pointing me into the right direction, because I tried to disable the defender or add custom rules and it did not work. What actually has worked is when I went to Windows Defender Firewall Properties and unchecked vEthernet WSL from being protected for all the profiles. |
Thank you for this! This worked |
Please use the following bug reporting template to help produce issues which are actionable and reproducible, including all command-line steps necessary to induce the failure condition. Please fill out all the fields! Issues with missing or incomplete issue templates will be closed.
If you have a feature request, please post to the UserVoice.
If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.
Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to [email protected]. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".
Please fill out the below information:
Your Windows build number: (Type
ver
at a Windows Command Prompt)10.0.18917.100
What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)
ping host machine, whose IP was obtained from /etc/resolv.conf.
What's wrong / what should be happening instead:
Ping timed out. Additionally, I can ping 8.8.8.8, but not www.google.com.
The text was updated successfully, but these errors were encountered: