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 · 75 comments

Comments

Projects
None yet
@patryk9200
Copy link

patryk9200 commented Apr 7, 2016

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

This comment has been minimized.

Copy link

fhelje commented Apr 7, 2016

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

@gdude2002

This comment has been minimized.

Copy link

gdude2002 commented Apr 7, 2016

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

@patryk9200

This comment has been minimized.

Copy link
Author

patryk9200 commented Apr 7, 2016

@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

nanogennari commented Apr 8, 2016

@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

This comment has been minimized.

Copy link

eternelpanic commented Apr 8, 2016

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

This comment has been minimized.

Copy link
Member

SvenGroot commented Apr 9, 2016

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

This comment has been minimized.

Copy link
Author

patryk9200 commented Apr 9, 2016

@SvenGroot Thanks for info!

@arjennienhuis

This comment has been minimized.

Copy link

arjennienhuis commented Apr 11, 2016

Why is this closed?

@gdude2002

This comment has been minimized.

Copy link

gdude2002 commented Apr 11, 2016

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

Is it fixed? I still get the same behaviour.

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Apr 11, 2016

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

This comment has been minimized.

Copy link

arjennienhuis commented Apr 11, 2016

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

sunilmut commented Apr 12, 2016

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

@ion-storm

This comment has been minimized.

Copy link

ion-storm commented Apr 17, 2016

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.

@thebigsmileXD

This comment has been minimized.

Copy link

thebigsmileXD commented Jan 10, 2017

Weird that it didnt load it, thanks alot though!

@engjedi

This comment has been minimized.

Copy link

engjedi commented Jan 20, 2017

Hey folks, is there any limitation or blocking with respect to cmd bash output redirection?
I tried to run a simple "script" with ping and filter with grep and give a redirect of the output of the command to a file, and it goes blank.
One detail is that if I redirect a command that works "ex: ls -la > file" it redirects the content.
The contents of the script
#! / Bin / bash
For i in {1..254};do
Echo -n "[$ i]"
Ping 172.15.31. $ I | Grep "64 bytes"> ping
done
EOF
I would like to show a total with wc -l, as there are 23 alive, searching for redirection, I did not find any answer.

@aseering

This comment has been minimized.

Copy link
Contributor

aseering commented Jan 20, 2017

Hi @engjedi , thanks for posting! This might actually be a better question for somewhere like StackOverflow, though: No, there are no restrictions on piping. But you appear to have some bugs in your script: > doesn't append; it overwrites, you would need >>. Also, Linux ping pings forever by default; you would need ping -c 1. (Also, Linux ping only works if WSL is run as a Windows Administrator in the current stable build of Windows; this is fixed in current Insider builds.) There are also issues with spacing and capitalization; I assume that's just a copy&paste issue, but in general it's helpful if you paste your exact script surrounded by triple backticks (``` code ```) so that it shows up as an unformatted block comment and folks can read it exactly.

In any case, most of those issues are general Linux shell-scripting concerns. I'd encourage you to experiment with your script a bit more and ask around on a shell-scripting forum. If you've tested your script on Linux and it works, and you've copied the script to WSL and it doesn't work, and you've narrowed it down to a particular part of the script (if it's a large script), and there's not an obvious existing ticket here covering the behavior, then at that point you've come to the right place; please go ahead and file a new ticket here and people will be happy to help.

@wartillo

This comment has been minimized.

Copy link

wartillo commented Jan 27, 2017

Hey,

I didn't read everything what people said about that thread, but i was facing that situation and to solve it, i just had to run bash as administrator.

I wish that could help

@aseering

This comment has been minimized.

Copy link
Contributor

aseering commented Jan 27, 2017

Hey @wartillo -- thanks for the observation! It sounds like you are not running an Insider build? (Many people here are, though certainly many others aren't.)

@wartillo

This comment has been minimized.

Copy link

wartillo commented Jan 27, 2017

Hey Assering,

Forgot to specify version that i'm using.
i'm using the Anniversary build.

Microsoft Windows [version 10.0.14393]

@karpulix

This comment has been minimized.

Copy link

karpulix commented Mar 24, 2017

if run Bash On Windows from administrator, command "ping" working correct.
(sorry for my english)

@subhammridha

This comment has been minimized.

Copy link

subhammridha commented Apr 22, 2017

Yes. Same here. But I don't understand why?
Rather, how can this be implemented in a terminal without administrative privilege?

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Apr 22, 2017

@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

This comment has been minimized.

Copy link

neguetam commented Apr 26, 2017

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

@subhammridha

This comment has been minimized.

Copy link

subhammridha commented Apr 27, 2017

@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

This comment has been minimized.

Copy link

karpulix commented Apr 28, 2017

@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

This comment has been minimized.

Copy link

neguetam commented Apr 28, 2017

no problem mate hope it helps you

good luck

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Apr 28, 2017

@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

This comment has been minimized.

Copy link

karpulix commented Apr 29, 2017

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

@brtmrl

This comment has been minimized.

Copy link

brtmrl commented May 31, 2017

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

@diveyez

This comment has been minimized.

Copy link

diveyez commented Jan 12, 2018

WSL has been nothing but problems.

@ryanerwin

This comment has been minimized.

Copy link

ryanerwin commented Jan 13, 2018

@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

This comment has been minimized.

Copy link

spacemishka commented Mar 6, 2018

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

This comment has been minimized.

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.

@mrmirnov

This comment has been minimized.

Copy link

mrmirnov 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

This comment has been minimized.

Copy link

gbminnock commented Dec 11, 2018

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

@ION28

This comment has been minimized.

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`

@Xeonacid Xeonacid referenced this issue Dec 27, 2018

Merged

Update ping #128

ethanhs added a commit to ethanhs/WSL-Programs that referenced this issue Dec 27, 2018

@sxpistols

This comment has been minimized.

Copy link

sxpistols commented Feb 14, 2019

sudo chmod u+s `which ping`

thank you, it worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment