-
Notifications
You must be signed in to change notification settings - Fork 823
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
Ping not working in wsl2 debian. #5109
Comments
Short answer, mortals don't have Dunno why You can make the binary
Borders tag linux-behavior, because WSL2 is doing what it's told. But the |
Thanks @therealkenc that is awsome. Thanks again. |
Great. Alright let's call this linux-behavior. If someone wants to dive whether the |
An alternative that I don't think was available last year when this was originally asked ... To handle this in all WSL2 distributions using kernel >= 5.8, create or edit your
This sets the "Range of the group IDs (minimum and maximum group IDs, inclusive) that are allowed to create ICMP Echo sockets." I kind of stumbled across this when I noticed that It turns out that for openSUSE and some other distributions (e.g. Fedora, I believe, if you attempted a rootfs The reason it was working for me, all of a sudden, is that I had run Systemd in one of my test distros (basic |
Also decided to test/confirm/refute the Debian side of things as @therealkenc suggested.
Per this Debian mailing list, yes, on Debian this is due to the use of security capabilities. And the problem still exists in the Bullseye release in the Store (an update since this issue was originally raised). However, it does not appear to be a
Pretty sure this is about the bare minimum for a busybox distro +
Whether or nor the capabilities persisted did depend on the
From this, it seems obvious that I'm not sure, but they may be using Debuerreotype. I know they use it for the Debian Docker image rootfs, and the project description "Reproducible, snapshot-based Debian rootfs builds (especially for Docker)" makes it sound like it may be used elsewhere, perhaps for the WSL rootfs. I'm guessing that If they are using Debuerreotype, then they do already know about the issue (and here) apparently. Unfortunately, they put in a Docker-specific fix instead of adding @therealkenc said:
Perhaps I'm mistaken, but I'm assuming that the WSL team has an upstream Debian contact that could look at this? Even if they don't/can't fix the packaging issue, perhaps they could add the capability during the initial WSL configuration (username/password create) step? They should probably also do an audit on any other capabilities they are using that have been lost under WSL. |
It's worth noting that Debian doesn't use SUID by default, not only in WSL. So we have to use the capabilities option. Standalone Debian installation user root capabilities: Debian WSL2 $ getcap /bin/ping So what we need to get ping working is to run the following command (assuming the path is /bin/ping): But if we run it as a normal user, we will get an error: So, we use sudo: Reference: https://blog.container-solutions.com/linux-capabilities-in-practice |
Apologies, but as far as I can tell all of what you wrote is covered above, mainly in therealkenc's comment and my confirmation of the capabilities hypothesis on Debian. |
For IPv6 see #4518 |
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data. im stuck |
I'm stuck too. |
Me too, it does not fix the issue. No connectivity here using WSL2 and Debian distro. |
bump |
Your Windows build number: 10.0.19041.207
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 8.8.8.8
What's wrong / what should be happening instead:
ping: socket: Operation not permitted
Is it possible that something is blocking icmp packets?
ssh works fine, so tcp seems to be OK.
Ta
Peter
The text was updated successfully, but these errors were encountered: