microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.43k stars 822 forks source link

Missing network connection in WSL2 after last (windows) update #5414

Closed Kinmarui closed 4 years ago

Kinmarui commented 4 years ago

Environment

Windows build number:  **Win32NT             10.0.19041.0 Microsoft Windows NT 10.0.19041.0**
Your Distribution version:  **Ubuntu 18.04 || Ubuntu 20.04 || Arch** 
Whether the issue is on WSL 2 and/or WSL 1: **WSL2** [run `cat /proc/version` in WSL]
Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020 
(pasting this since I was it was frequent request with problems with network adapters for wsl (not sure if there is difference in wsl and wsl2 here)
PS Host> Get-NetAdapter | Format-Table Name,InterfaceDescription,ifIndex,Status,LinkSpeed,MediaConnectionState

Name                         InterfaceDescription                                                       ifIndex Status       LinkSpeed MediaConnectionState
----                         --------------------                                                       ------- ------       --------- --------------------
Ethernet                     Qualcomm Atheros AR8171/8175 PCI-E Gigabit Ethernet Controller (NDIS 6.30)      22 Disconnected 0 bps             Disconnected
Local Area Connection        TAP-Windows Adapter V9                                                          20 Disabled     1 Gbps                 Unknown
vEthernet (WSL)              Hyper-V Virtual Ethernet Adapter #2                                             53 Up           10 Gbps              Connected
Bluetooth Network Connection Bluetooth Device (Personal Area Network)                                        18 Disconnected 3 Mbps            Disconnected
Wi-Fi                        Intel(R) Centrino(R) Wireless-N 2230                                            17 Up           54 Mbps              Connected
vEthernet (Default Switch)   Hyper-V Virtual Ethernet Adapter                                                34 Up           10 Gbps              Connected
Ethernet 3                   TAP-NordVPN Windows Adapter V9                                                   8 Disabled     1 Gbps                 Unknown

Steps to reproduce

It was either after upgrading to 10.0.19041.0 or upgrading wsl-kernel.

Expected behavior

Should continue to have access to network interface

Actual behavior

both consoles (Arch and Ubuntu) starts with ioctl(SIOCGIFADDR): Address not available

I don't have ifconfig on Ubuntu but Arch returns

[root@KinL ~]# ip address
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether d6:07:2b:8c:de:42 brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 1e:2a:17:48:f0:10 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:15:5d:11:b0:13 brd ff:ff:ff:ff:ff:ff

not sure if this is same problem or related but when I wanted to reinstall wsl-kernel I got 2020-06-16 01_13_41-Window and then installer exited with error.

What I did already

  1. I have already disabled (restarted PC) enabled windows subsystem for linux.
  2. I have used windows Network Status > Network Reset option
  3. I thought it was related to docker for windows so I uninstalled and reinstalled it (tried both edge and stable versions).

Network for wsl 1 distro (Ubuntu-16) works correctly

cat /proc/version
Linux version 4.4.0-19041-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Fri Dec 06 14:06:00 PST 2019

Any help will be greatly appreciated as I'm out of options and looking at formatting system drive.

therealkenc commented 4 years ago

Thanks for the detailed post. Similar symptom #5336 #5286 #4731.

The ioctl(SIOCGIFADDR): Address not available at startup is novel though. And unusual, because presumably that is coming from WSL-brand /init, and /init is usually silent about its errors. Or maybe that text is coming from wsl.exe. Grab a screencap of that if you can.

Please follow collect network logs over in contributing.

Uninstalling third-party things (TAP-NordVPN and whatever else) is sometimes a good place to start.

Kinmarui commented 4 years ago

thanks for your reply. I tried to follow instructions but it appears that I might have at some point (long ago) uninstalled FeedbackApp when everything was working smoothly. Tried to install it again but I don't see it on the list.

Is there manual way of uploading diagnostic data?

FWIW screenshot from terminal image

Kinmarui commented 4 years ago

tied to follow manual configuration from https://github.com/microsoft/WSL/issues/5286 but with no success (I may be calculating addresses in wrong way)

#win
Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 172.30.240.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

#linux
sudo ip address add 172.30.240.10/20 broadcast 172.30.255.255 dev eth0
...
5: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:15:5d:11:b0:13 brd ff:ff:ff:ff:ff:ff
    inet 172.30.240.10/20 brd 172.30.255.255 scope global eth0
       valid_lft forever preferred_lft forever
root@KinL:~# sudo ip route add default via 172.30.240.1
Error: Nexthop has invalid gateway.

going to bed. It's 4:44 here.

therealkenc commented 4 years ago

Feedback hub is here. Those linked instructions appear to be pretty ancient.

Kinmarui commented 4 years ago

Thanks, probably to tired yesterday. Installed app and send feedback.

Kinmarui commented 4 years ago

@therealkenc Do you have any idea if this is currently worked on or is it high priority in backlog? Is there chance it will be fixed soon (I mean day-three days) or should I try to go back to previous version of windows? (little bit afraid it will break more things)

Kinmarui commented 4 years ago

FWIW problem was fixed after recreating swap file following info in https://github.com/microsoft/WSL/issues/5437 which recommended disabling it

IMO it would help if there would be some kind of error msg if there is problem with swap file.

therealkenc commented 4 years ago

/dupe #5437

ghost commented 4 years ago

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!