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

Ping is not working #18

Closed
patryk9200 opened this issue Apr 7, 2016 · 79 comments
Closed

Ping is not working #18

patryk9200 opened this issue Apr 7, 2016 · 79 comments
Labels

Comments

@patryk9200
Copy link

Ping is not working on WSL.

When used, returns:
# ping google.com
ping: icmp open socket: Socket type not supported

@patryk9200 patryk9200 changed the title ping not working Ping is not working Apr 7, 2016
@fhelje
Copy link

fhelje commented Apr 7, 2016

Have the same issue network doesn't work, running windows in parallels on a mac

@gdude2002
Copy link

I got networking working on mine by disabling my AV's firewall, but it doesn't fix ping.

@patryk9200
Copy link
Author

@fhelje @gdude2002 For me network is working, I can sucessfully download content from internet for example: wget google.com but what is not working is ping command and some other network related stuff.

@jolibert
Copy link

jolibert commented Apr 7, 2016

I confirm that requests out of a normal, SYN/SYN-ACK/ACK TCP connection (transport -UDP- and network -ICMP even locally- layers on ISO model) are not working.
Normally it is looking good to disallow communications at the network level and below, but for internal developments, it should be considered as back-end business related.

@kjk
Copy link

kjk commented Apr 7, 2016

Same issue when using 14316 in latest Parallels on latest Mac OS X.

Inside bash, network doesn't seem to work. DNS resolution fails, ping a fixed address doesn't work:

root@localhost:~# ping google.com
ping: unknown host google.com
root@localhost:~# ping 8.8.8.8
ping: icmp open socket: Socket type not supported

The same commands work inside cmd.exe.

This means that apt-get doesn't work so I can't install any additional packages.

I tried both "Shared Network" and "Bridged Network" networking modes of Parallels.

It might be deficiency of (or incompatibility with) Parallel's network driver.

Happy to provide more info from within bash (given that network stack is probably emulated in WSK I wouldn't know what behavior standard linux network debugging techniques is buggy but expected vs. unexpectedly buggy).

@nanogennari
Copy link

@kjk It loos like there are two different issues, one is with DNS resolutions, and it is easily solved, just add a DNS server to /etc/resov.conf, it shoud look like:

root@localhost:/# cat /etc/resolv.conf
nameserver 10.10.10.1

After that apt-get shoud work.

The second issue is with ping, i'm having the same problem here:

root@localhost:/# ping 10.10.10.1
ping: icmp open socket: Socket type not supported

@eternelpanic
Copy link

Traceroute is no better:
root@localhost:~# traceroute www.internode.on.net
traceroute to www.internode.on.net (150.101.140.197), 30 hops max, 60 byte packets
setsockopt IP_MTU_DISCOVER: Invalid argument

@SvenGroot
Copy link
Member

ICMP is currently not supported, which is why "ping" fails. We realize that this makes it inconvenient to diagnose possible networking issues, and are working to address this.

@patryk9200
Copy link
Author

@SvenGroot Thanks for info!

@arjennienhuis
Copy link

Why is this closed?

@gdude2002
Copy link

..huh, I didn't get an email for this.

Is it fixed? I still get the same behaviour.

@sunilmut
Copy link
Member

Yes, any network tools that rely on NETLINK or ICMP do not currently work and we are aware of this. We will be tracking\prioritizing which features to light up next by looking at the feedback provided at the wpdev portal. We appreciate your feedback and please make sure to provide it through the wpdev portal as well. Looks like there is already a post tracking this which you can up vote (or add a new one):

https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13383789-enable-network-interface-enumeraration

@arjennienhuis
Copy link

Closing the issue is still a bad idea and also a bit rude.

A nicer way is to tag it as 'wishlist', 'feature' or even 'backlog'

@bitcrazed bitcrazed modified the milestones: Anniversary Update, Future Apr 11, 2016
@fungus
Copy link

fungus commented Apr 12, 2016

Not only is closing the issue a bad idea, referencing a feedback post that has a description completely unrelated to this issue is really bad.

No one viewing that feedback post will think it relates to this issue.

@sunilmut
Copy link
Member

@arjennienhuis, @fungus - Feedback taken regarding closing the issue. I will keep this in mind going forward.

@ion-storm
Copy link

I have multiple networking tools that I cannot use due to this bug effecting ping, dig and anything raw socket related. Please address and prioritize this bug since Linux networking is a core feature of Linux and this bug probably spans thousands of Linux packages.

@sunilmut
Copy link
Member

@karpulix, @subhammridha - Which windows build are running? Please share output of the ver command from cmd. It seems like both of you are on Anniversay Update build (14393). In Creators Update 15063, admin is no longer needed to run ping.

@neguetam
Copy link

just run " Bash ubuntu for windows " as administrator and that's it he can get permission for using socket

@ombrophile
Copy link

@sunilmut, yes I'm using anniversary update build of windows 10 and have not yet upgraded to creators update. I will though.

Btw thanks for the info.

@karpulix
Copy link

@sunilmut i use version 1607 (OS build 14393.1066). I can't use "ping" in bash if run bash without administrator permission. Maybe it depends from region updates. I'm from Russia.

p.s. sorry for my english

@neguetam
Copy link

no problem mate hope it helps you

good luck

@sunilmut
Copy link
Member

@karpulix - No worries, thanks for using WSL. See if the Creators Update is available to you or you can install it. It should solve your problems with ping and many other.

@karpulix
Copy link

@sunilmut Thank you! I'm update system and it problem resolved.

@brtmrl
Copy link

brtmrl commented May 31, 2017

No need to update. Login as an administrator not as a guest.

@diveyez
Copy link

diveyez commented Jan 12, 2018

WSL has been nothing but problems.

@ryanerwin
Copy link

@diveyez

ping has been working for several months, I think since the first creators update.

WSL is still not perfect, but it's pretty impressive to me that compiled Linux binaries can use the Windows kernel in place of the Linux kernel and most of it works.

You can always run a VM if WSL doesn't deliver what you need. I'm eager for when WSL support is complete - no bugs at all. Personally I already find it less frustrating than trying to build Linux tools to run natively on Mac OS X, and it's getting better with each release.

@spacemishka
Copy link

I am trying to setup WSL but getting still errors on ping

user@nb-999:~$ ping google.de ping: unknown host google.de user@nb-999:~$ ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. ping: sendmsg: Invalid argument ping: sendmsg: Invalid argument

resolv.conf:

user@nb-999:~$ cat /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4

@aseering
Copy link
Contributor

aseering commented Mar 6, 2018

Hi @spacemishka -- what version/build of Windows are you running? (Type ver at a Windows Command Prompt.)

This is a common issue with older releases of Windows 10, but a fix was released via Windows Update.

@mivsmirnov
Copy link

mivsmirnov commented Nov 15, 2018

Hi!

Still cannot run ping even if run-as admin mode until sudo it:
Microsoft Windows [Version 10.0.16299.726]
msmirnov@smirnov:/mnt/c/Windows/System32$ ping www.ru
ping: socket: Operation not permitted
msmirnov@smirnov:/mnt/c/Windows/System32$ sudo ping www.ru
PING www.ru (217.112.35.75) 56(84) bytes of data.
64 bytes from v76-u.valuehost.ru (217.112.35.75): icmp_seq=1 ttl=53 time=14.6 ms
64 bytes from v76-u.valuehost.ru (217.112.35.75): icmp_seq=2 ttl=53 time=15.10 ms
64 bytes from v76-u.valuehost.ru (217.112.35.75): icmp_seq=3 ttl=53 time=14.5 ms

@gbminnock
Copy link

works fine as others have said when I run the Kali app as Administrator.

@ION28
Copy link

ION28 commented Dec 27, 2018

for anyone still running into this issue, the below command fixed it for me:

sudo chmod u+s `which ping`

emmatyping pushed a commit to emmatyping/WSL-Programs that referenced this issue Dec 27, 2018
@sxpistols
Copy link

sudo chmod u+s `which ping`

thank you, it worked for me

@harryqt
Copy link

harryqt commented Jun 1, 2020

for anyone still running into this issue, the below command fixed it for me:

sudo chmod u+s `which ping`

Installed Ubuntu 20.04 on WSL 2, ran into the same issue. But that solution worked. 👍

@fuomag9
Copy link

fuomag9 commented Jun 5, 2020

for anyone still running into this issue, the below command fixed it for me:

sudo chmod u+s `which ping`

Brand new windows 2004 kali wsl2 install, this fixed it for me as well, thanks!

@mspncp
Copy link

mspncp commented Sep 7, 2020

FWIW: according to the manual page, it is sufficient to set the CAP_NET_RAW capability. The following command worked for me:

sudo setcap cap_net_raw+ep `which ping`

Whether this method is safer than 'set-uid root' or not, I can't tell.

@toor11
Copy link

toor11 commented Jul 6, 2021

That is a permission issue:
Before :

user@localhost:~$ for n in {1..5}; do ping 1.1.1.1; done
ping: socket: Operation not permitted
ping: socket: Operation not permitted
ping: socket: Operation not permitted
ping: socket: Operation not permitted
ping: socket: Operation not permitted

AFTER:

user@localhost:~$ sudo setcap cap_net_raw+p /bin/ping
[sudo] password for user:
user@localhost:~$ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=50 time=46.2 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=50 time=45.0 ms

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

No branches or pull requests