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

Issues with ifconfig, sockets, nmap, ping, nslookup, dig and others not working #69

Closed
javydekoning opened this Issue Apr 8, 2016 · 76 comments

Comments

Projects
None yet
@javydekoning
Copy link

javydekoning commented Apr 8, 2016

nmap:

root@localhost:/mnt/c/users/jdekoning# nmap google.com

Starting Nmap 6.40 ( http://nmap.org ) at 2016-04-08 12:37 UTC
route_dst_netlink: cannot create AF_NETLINK socket: Invalid argument

Ping:

root@localhost:/mnt/c/users/jdekoning# ping google.com
ping: icmp open socket: Socket type not supported

nslookup:

root@localhost:/mnt/c/users/jdekoning# nslookup google.com
socket.c:2447: setsockopt(20, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 10.142.23.200#53: Invalid argument
socket.c:2447: setsockopt(21, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 10.141.23.200#53: Invalid argument
socket.c:2447: setsockopt(22, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 10.130.23.100#53: Invalid argument

traceroute:

root@localhost:/mnt/c/users/jdekoning# traceroute 8.8.4.4
traceroute to 8.8.4.4 (8.8.4.4), 30 hops max, 60 byte packets
setsockopt IP_MTU_DISCOVER: Invalid argument

DIG:

root@localhost:/mnt/c/users/jdekoning# dig @8.8.4.4 google.com
socket.c:2447: setsockopt(20, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 8.8.4.4#53: Invalid argument

@javydekoning javydekoning changed the title Issues with socket.c nmap,ping and nslookup not working. Issues with socket.c: nmap,ping,nslookup,dig and others not working. Apr 8, 2016

@Aneurin

This comment has been minimized.

Copy link

Aneurin commented Apr 8, 2016

All of the ones which produce "socket.c: 1915: internal_send ..." are BIND tools that don't seem to work here. You can install the Knot DNS equivalents which do, using apt-get install knot-host knot-dnsutils, to get working dig and host at least, though it doesn't seem like there's a Knot nslookup.

For the rest, it looks like only certain types of sockets can be created. Maybe raw sockets aren't permitted so we can only open TCP and UDP sockets? You would at least expect ICMP to be available though.

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Apr 11, 2016

Yes, NETLINK sockets are currently not implemented. ICMP is also currently not supported. UDP and TCP sockets should work fine though. 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

@sunilmut sunilmut closed this Apr 11, 2016

@sunilmut sunilmut reopened this Apr 18, 2016

@sunilmut sunilmut added the network label Apr 22, 2016

@nianyush

This comment has been minimized.

Copy link

nianyush commented Apr 26, 2016

so when this problem can be solved?

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Apr 26, 2016

@xiaoyu9964 Thanks for your patience and we understand that not having basic network tools working, can be frustrating. That being said, support for RAW/ICMPv4 sockets are being checked in our development branch. That should unblock ping. ping6 still doesn't work. We are working to unblock these scenarios as well in future. Meanwhile, please help us prioritize this by up voting this specific request in the User Voice page. Thanks again for trying WSL and providing feedback.

@MadcowD

This comment has been minimized.

Copy link

MadcowD commented May 1, 2016

This issue is causing issues with libzmq and other socket libraries.

Related issue is #134

@Deshke

This comment has been minimized.

Copy link

Deshke commented Jul 17, 2016

any update on this? network is a rather big point and should work

@aseering

This comment has been minimized.

Copy link
Contributor

aseering commented Jul 17, 2016

A lot has changed since this ticket was last updated. It's probably be worth re-testing the specific issues reported here.

@ldanicel

This comment has been minimized.

Copy link

ldanicel commented Jul 17, 2016

I just fresh installed 4 days ago and it acts the same.

@aseering

This comment has been minimized.

Copy link
Contributor

aseering commented Jul 17, 2016

This issue is actually an aggregation of a bunch of bugs, some of which are known to be fixed. Could you please include your specific Windows build and which of the issues on this ticket you tested?

@aseering

This comment has been minimized.

Copy link
Contributor

aseering commented Jul 17, 2016

In particular, off the top of my head, ping is #18 and libzmq is #185.

Note that both are fixed with caveats; more details are available on those tickets.

@ldanicel

This comment has been minimized.

Copy link

ldanicel commented Jul 17, 2016

traceroute, mtr, ifconfig, ip, route, tcpdump, nmap are not functioning at all
`
root@CASH:~# mtr google.com
mtr: unable to get raw sockets.

root@CASH:~# traceroute google.com
traceroute to google.com (82.76.231.39), 30 hops max, 60 byte packets
setsockopt IP_MTU_DISCOVER: Invalid argument

root@CASH:~# nmap -O google.com
Starting Nmap 6.40 ( http://nmap.org ) at 2016-07-18 00:13 DST
route_dst_netlink: cannot bind AF_NETLINK socket: Invalid argument

root@CASH:~# route -n
/proc/net/route: No such file or directory
INET (IPv4) not configured in this system.

root@CASH:~# ip addr show
SO_SNDBUF: Invalid argument

root@CASH:~# tcpdump
tcpdump: getifaddrs: Invalid argument

`

ping looks to be ok but still has some spookie latencies reported, like:

ping google.com
PING google.com (82.76.231.25) 56(84) bytes of data.
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=1 ttl=61 time=0.518 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=2 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=3 ttl=61 time=2.52 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=4 ttl=61 time=2.36 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=5 ttl=61 time=2.00 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=6 ttl=61 time=2.50 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=7 ttl=61 time=2.53 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=8 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=9 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=10 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=11 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=12 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=13 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=14 ttl=61 time=2.41 ms

windows build is Microsoft Windows [Version 10.0.14388]

@Deshke

This comment has been minimized.

Copy link

Deshke commented Jul 18, 2016

i'm currently on Windows 10 Insider Preview 14390 - and i've got the same issues as in #69 (comment)

@Skalin

This comment has been minimized.

Copy link

Skalin commented Jul 28, 2016

14394 - still not working properly, traceroute does not work

@vnodecg

This comment has been minimized.

Copy link

vnodecg commented Aug 4, 2016

Any update on this?

@CharlieEriksen

This comment has been minimized.

Copy link

CharlieEriksen commented Aug 4, 2016

When you started Bash with administrative privileges, not sudo, and nmap 192.168.1.1, you get this error instead:

Starting Nmap 6.40 ( http://nmap.org ) at 2016-08-04 19:39 DST
Problem binding to interface , errno: 22
socket_bindtodevice: Invalid argument
NSOCK ERROR [1.1340s] mksock_bind_device(): Setting of SO_BINDTODEVICE failed (IOD #1): Invalid argument (22)
NSOCK ERROR [1.1340s] mksock_bind_device(): Setting of SO_BINDTODEVICE failed (IOD #2): Invalid argument (22)
NSOCK ERROR [1.1350s] mksock_bind_device(): Setting of SO_BINDTODEVICE failed (IOD #3): Invalid argument (22)
Problem binding to interface , errno: 22
socket_bindtodevice: Invalid argument
Problem binding to interface , errno: 22
socket_bindtodevice: Invalid argument
Problem binding to interface , errno: 22

Ping works when you run it with administrative privileges.

@DennisSc

This comment has been minimized.

Copy link

DennisSc commented Aug 5, 2016

inetutils-traceroute gives the following error:
traceroute: setsockopt: invalid argument

ping works now, and name resolution too (I added 127.0.0.1 mywindowspcname. to /etc/hosts, don't know if this helps but it remedied the error "host not found" when issuing pings to IP addresses I think)

Lokks like things are still under construction...

edit - "arp" command doesn't work neither

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented May 18, 2017

The major blocker behind mtr, tracepath, nmap et. al. is the support for AF_PACKET, as correctly pointed out by @mateusmedeiros. Unfortunately, Windows itself does not has support for raw access to the ehternet. We (WSL team) continue to work with the Windows networking team to bring some of these features natively to Windows, which then can be lightened up in WSL.
And, yes, we do take the uservoice page seriously while prioritizing features. So, the best bet here is to head down to uservoice page and help us prioritize by casting your votes there.

@DJviolin

This comment has been minimized.

Copy link

DJviolin commented May 18, 2017

You know you have to unsub from a git issue, when you reading about Mercedes E63s, and you still driving a 35 year old Audi 80...
And it still works because we replaced some stock parts in time, before some issues (although it's rotting like crazy).

@n8cn

This comment has been minimized.

Copy link

n8cn commented May 18, 2017

@JBFUK

This comment has been minimized.

Copy link

JBFUK commented May 18, 2017

I guess you're right - unlucky that the tools I wanted to use don't work yet, maybe one day. If the tools you like to work with will run then good for you.

@mmathys

This comment has been minimized.

Copy link

mmathys commented May 18, 2017

@gudenuff my comment sounds harsh sorry for that. I do appreciate the efforts of Microsoft and believe that they are doing the right thing with Windows.

However, one can't deny that at this state lots of things are broken and IMO it's frustrating

@wildan2711

This comment has been minimized.

Copy link

wildan2711 commented May 28, 2017

I was dang excited when I saw this project because it means I didn't have to run a VM to do my networking tasks which was only available in Ubuntu, too bad it's one of the main weakness/issue in this project. Well just have to wait now, great job though WSL team..

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Jun 13, 2017

I am going to close this issue out because it is a "catch-all" issue for a lot of different networking tools and has become unmanageable. It will be easier to track the individual networking tools that are not working with separate issues.

As of Creators Update, the following tools should work:

  • ping
  • dig
  • ifconfig
  • ip link
  • ip addr show
  • ifconfig
  • whois
  • nslookup
  • ip route
  • ip addr add/delete

Not working:

If you would like to see support for any additional tools, please open a new issue. Thanks all for chiming in here.

@yesterday679

This comment has been minimized.

Copy link

yesterday679 commented Jul 12, 2017

netstat still not work,
one question , how can i get 80 port when i use nginx ?

@ahmedAlmasri

This comment has been minimized.

Copy link

ahmedAlmasri commented Jul 14, 2017

nmap still not working

route_dst_netlink: cannot bind AF_NETLINK socket: Invalid argument

@wirehack7

This comment has been minimized.

Copy link

wirehack7 commented Jul 23, 2017

I am getting errors while doing dig:

$ dig google.de
../../../../lib/isc/unix/socket.c:2104: internal_send: 192.168.0.1#53: Invalid argument
../../../../lib/isc/unix/socket.c:2104: internal_send: 192.168.0.1#53: Invalid argument

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.de
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57137
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.de.                     IN      A

;; ANSWER SECTION:
google.de.              299     IN      A       172.217.22.195

;; Query time: 108 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Jul 23 14:10:02 DST 2017
;; MSG SIZE  rcvd: 54
@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Jul 25, 2017

@wirehack7 - dig should work starting Insider build 16176. It will also be available in Fall Creators Update.

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Jul 25, 2017

@yesterday679 - Thanks for the feedback. We are aware of netstat not working. Regarding port 80, you will have to see where the collision is coming from, using netstat.exe. Or otherwise, just use a different port.

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Jul 25, 2017

@ahmedAlmasri - Thanks for your post. nmap not working is a known issue and is being tracked at #1349 and #2039

@outofcontrolnate

This comment has been minimized.

Copy link

outofcontrolnate commented Aug 18, 2017

Trying to run tcpdump and getting "tcpdump: socket: Invalid argument" any suggestions or fixes?

@sunilmut

This comment has been minimized.

Copy link
Member

sunilmut commented Aug 25, 2017

@outofcontrolnate - tcpdump does not work currently because of the lack of PF_PACKET socket address family on WSL (and on Windows). Here is the user voice ticket. Please upvote if you would like us to prioritize this.

@haidescs

This comment has been minimized.

Copy link

haidescs commented Oct 16, 2017

How to solve this problem? @ldanicel I meet the save issue with you, do you solve this issue yet?

@OvermindDL1

This comment has been minimized.

Copy link

OvermindDL1 commented Oct 18, 2017

@sunilmut Your link just displays Forbidden on an otherwise empty page...

And yep, still see the same issue near a year later...

@erlinux

This comment has been minimized.

Copy link

erlinux commented Nov 18, 2017

So is this problem solved?

@bitcrazed

This comment has been minimized.

Copy link
Collaborator

bitcrazed commented Nov 20, 2017

THIS THREAD IS CLOSED - please take discussion to more specific and therefore actionable issues.

This bug is a pain because it lists several networking tools which were/are not working because of several different, and unrelated issues.

As noted in @sunilmut's message just prior to closing this issue:

  • Ping was fixed in Creators Update. Nslookup/dig/etc. all work well on Fall Creators Update and later.
  • We're working on improving support for several tools, inc. traceroute, route, etc.

IP config tools are a lower priority right now, but can be worked-around by calling Windows commands to manage IP configuration via interop.

Tools requiring raw sockets (e.g. nmap, wireshark) are not currently supported on WSL. As noted in the Microsoft docs on Raw Sockets,

Raw sockets offer the capability to manipulate the underlying transport, so they can be used for malicious purposes that pose a security threat. Therefore, only members of the Administrators group can create sockets of type SOCK_RAW on Windows 2000 and later.

We are looking into improving things here, but it's not our highest priority since there are already many tools available on Windows for network penetration testing, packet capture, etc.

Please make this the last reply to this thread - take further discussion to more specific and therefore more actionable issues.

Thanks.

@nakedgoat

This comment has been minimized.

Copy link

nakedgoat commented Sep 24, 2018

nmap has some errors and arp fails w/no such f/d on my windows box at home; however everything else works ping, dig, nslookup & ifconfig, on my work computer ALSO windows 10 also running bash as an admin (only real difference is work computer is on a domain via vpn) @ work non of said commands work for me.. i've updated/upgraded both systems no real changes to much .. anyway hope this might help let me know if details are needed - even tho tread is closed :)

@adamfortuno

This comment has been minimized.

Copy link

adamfortuno commented Dec 3, 2018

tcptraceroute doesn't work either.

tcptraceroute 10.140.103.197 3389

If I'm root, the error I get reads as follows:

error opening device eth2: eth2: socket: Invalid argument

If I'm not root, the error I get reads as follows:

error opening device wifi0: wifi0: socket: Invalid argument

I'm running the following version of tcptraceroute:

tcptraceroute 1.5beta7
Copyright (c) 2001-2006 Michael C. Toren <mct@toren.net>
Updates are available from http://michael.toren.net/code/tcptraceroute/
@MCMainiac

This comment has been minimized.

Copy link

MCMainiac commented Jan 24, 2019

When will this be fixed?

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