Skip to content

[WSL2] No network #4731

Closed
Closed

Description

@awson

Microsoft Windows [Version 10.0.19025.1]

Any network activity from inside WSL2 ends up with:

../../../../lib/isc/unix/net.c:592: probing sendmsg() with IP_TOS=b8 failed: Network is unreachable
;; connection timed out; no servers could be reached

ifconfig -a reports:

bond0: flags=5122<BROADCAST,MASTER,MULTICAST>  mtu 1500
        ether 2e:fb:1b:47:93:0a  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

dummy0: flags=130<BROADCAST,NOARP>  mtu 1500
        ether 8a:4f:89:cc:4f:f8  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:15:5d:f5:b7:63  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=8<LOOPBACK>  mtu 65536
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=128<NOARP>  mtu 1480
        sit  txqueuelen 1000  (IPv6-in-IPv4)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vEthernet (WSL) adapter is present and enabled and reports no problems.

It all worked fine till today. Today it stopped working with absolutely no apparent reason. No installations, no updates ...

I tried everything except reinstalling the whole system (which apparently I won't do, since I'll install release if decide to remove insider's), nothing helps.

Activity

  1. God-damnit-all commented on Dec 4, 2019

    @God-damnit-all

    I'm having the same problem on 19033. This is bizarre.

  2. craigloewen-msft commented on Dec 4, 2019

    @craigloewen-msft
    Member

    Are you using a VPN? Or any other kind of networking configuration that could affect it?

    And could you please take a networking trace for us and post the feedback item here?

    Thanks!

  3. awson commented on Dec 4, 2019

    @awson
    Author

    I use no VPN and/or any other peculiar networking configuration, at least I've changed nothing since previous days when things were OK.

    I've created and sent the feedback according to your link but I don't know what "feedback item" is, and what should I post here (I'm also not logged in and I can't retrieve my feedback then).

    I've also checked "Save log data locally" or similar (I don't remember the wording) checkbox but nothing interested happened.

    I've looked into C:\ProgramData\Microsoft\Windows\WER\ReportArchive directory and found 3 recently created Critical..... directories (among older ones) with Report.wer file in each, which contain basically only the links to temporary (now gone) files used to create the report.

  4. God-damnit-all commented on Dec 5, 2019

    @God-damnit-all

    Upgraded to 19035 and it seems to magically be working again.

  5. awson commented on Dec 5, 2019

    @awson
    Author

    Same here. Have just upgraded and it works now.

    Are there Wsl 2-related registry (or other config) entries which may be purged completely to have a chance to be rewritten by the healthy ones?

  6. ricardosantos9521 commented on Dec 8, 2019

    @ricardosantos9521

    This is happening to me after my pc goes to sleep for long hours. Shutting down wsl2 (wsl.exe --shutdown) and open it again solves the problem until the next time the pc goes to sleep again for long hours.

  7. God-damnit-all commented on Dec 8, 2019

    @God-damnit-all

    Sleep/Hibernate isn't enabled on my machine, though.

    I have noticed a lot more free space on my system disk with 20H1, and so I'm wondering if this might have something to do with the compression tech Windows is now using to shrink the size of system files. Perhaps it's touching WSL, or something WSL interacts with.

    It hasn't happened to me since the 19035 update, though.

  8. Biswa96 commented on Dec 8, 2019

    @Biswa96

    I am using WSL2 in Windows 10 insider build 19035 without any issue. You can check something like -- if eth0 interface present in wsl2, if ping to ip address work, if vEthernet (wsl) present in Windows, if Windows firewall has two inbound rules containing hns string etc. Also add the strace and/event logs as stated here.

  9. CalBR commented on Dec 11, 2019

    @CalBR

    I was using build 19033 without problems. Updated to 19037 and my internet stopped working. To be able to use the internet I had to set the nameserver to 8.8.8.8 in the /etc/resolv.conf which solves the connection failure but keeps me from using the X410. Any suggestions?

  10. God-damnit-all commented on Dec 11, 2019

    @God-damnit-all

    CalBR We're all as confused as to why it randomly breaks as you are, and the tools to try and diagnose it aren't able to gather any useful information.

    19041 is out and it might be a good idea to build an iso with https://UUPdump.ml and do an in-place upgrade.

  11. qqkookie commented on Dec 19, 2019

    @qqkookie

    I am using Window 10 Insider Beta version 2004 Build 19041.1. I installed latest Ubuntu app from MS App Store. It works fine in WSL version 1.

    But after conversion to WSL 2 , network does not work.
    Even ping 127.0.0.1 does not work. ( network unreachable )
    nslookup result: /../../../lib/isc/unix/net.c:592: probing sendmsg() with IP_TOS=b8 failed: Network is unreachable.

    I tried various fix suggested in other threads but they does not work.
    It is not DNS problem or /etc/resolv.conf or nsswitch.conf.

    TCP/IP network socket just stopped working in WSL 2 on Window 10 Build 19041.
    Linux kernel does not recognize network interfaces of PC.
    Unix domain socket works fine.

    Only working solution is converting back to WSL 1. Then it works fine again.

    In attached text file, there is ifconfig -a results on WSL 2 and WSL 1, respectively.

    WSL-ifconfig.txt

  12. rm-bergmann commented on Dec 19, 2019

    @rm-bergmann

    I have exactly the same problem. No problems with WSL2 on my office PC, only my home PC.
    I've also tried all suggested fixes and still unable to get it working. Worst thing for me now is docker desktop stopped working on WSL1 so when I convert back to WSL1 I just get weird input / output errors now. I would rather have WSL2 fixed anyway.

  13. rm-bergmann commented on Jan 27, 2020

    @rm-bergmann

    Finally I solved my problem. In Hyper-V Manager > Virtual Switch Manager > WSL Adapter, switched to External Network and selected my WIFI network. Inside WSL I gave it a 192.168 IP address which is in the same range as my WIFI network, rather than the 172. range that is generated, and I had to add the 192.168 ip address in /etc/resolv.conf. I still don't know why the NAT / Internal switch doesn't work.

  14. secopsbot commented on Feb 5, 2020

    @secopsbot

    Same problem if/when my laptop hibernates, rebooting is the only thing that currently resolves.

    Did you need to do anything before changing the connection type Rick Bergmann (@rm-bergmann) when I try to change my WSL Adapter to any External Network I'm getting the error below.

    Virtual Switch Manager for secopsbot
    
    Error applying Virtual Switch Properties changes
    
    Adding ports to the switch 'WSL' failed.
    
    The operation failed because the object was not found.
    
  15. rm-bergmann commented on Feb 5, 2020

    @rm-bergmann

    Matt Robey (@secopsbot) I think I hit that error a few times, then I hat to shut down WSL2 and run Hyper-V as administrator. The annoying thing was I had to repeat the process after every reboot. I also remember I had to right click on the wifi network adapter (in the 'view network connections' windows) and click "Remove from Bridge".

    I have since deleted that instance of WSL2, and set up a new one using that same process. I can get network, but now I get the DNS resolving issue.

  16. 43 remaining items

  17. kreczko commented on Jun 15, 2021

    @kreczko

    Ubuntu 18.04 and 20.04 (i.e. all WSL distributions) do not have any network connectivity (not even localhost).
    It seems the network interface for WSL is gone. Host network is working fine.

    OS Name Microsoft Windows 10 Pro
    Version 10.0.19043 Build 19043

    Virtualization-based security Running
    Virtualization-based security Required Security Properties
    Virtualization-based security Available Security Properties Base Virtualization Support
    Virtualization-based security Services Configured
    Virtualization-based security Services Running
    A hypervisor has been detected. Features required for Hyper-V will not be displayed.

  18. janfrederik commented on Jul 6, 2021

    @janfrederik

    No connectivity from wsl2 to the internet after Windows update KB5003537 was applied automatically last night.
    I uninstalled the update and everything working fine again.

  19. craigloewen-msft commented on Jul 6, 2021

    @craigloewen-msft
    Member

    Jan Frederik Léger (@janfrederik) if you're seeing this from the latest update could you please collect networking logs and post them to this Github issue: #7141

    Instructions here: #7141 (comment)

  20. janfrederik commented on Jul 10, 2021

    @janfrederik

    Jan Frederik Léger (@janfrederik) if you're seeing this from the latest update could you please collect networking logs and post them to this Github issue: #7141

    Craig Loewen (@craigloewen-msft) Yesterday I installed the "2021-07 Cumulative Update for Windows 10 Version 20H2 for x64-based Systems (KB5004945)" and had no problems afterwards.
    So it seemed to be specific to KB5003537 (which is part of KB5004945 because Windows Update does not suggest it anymore?).

  21. LOuroboros commented on Nov 15, 2021

    @LOuroboros

    dezza I resolved my issue in the context of your answer:

    Container Management Service needed to be shutdown first. This is working for a re-jolt of the networking in WSL2 from suspend mode.

    # sc stop cmservice
    # sc stop hns
    # sc stop vmcompute
    # sc stop lxssmanager
    

    Then start them back up again.

    Depression has ended. 😁😍😘🥰

    Thank you very much, this worked perfectly on my end!

    I didn't need to restart the cmservice though. I actually don't even have it in my copy of Windows.

    Just stopping hns, vmcompute, lxssmanager and then starting them again using sc start worked wonderfully!

  22. Wolvverine commented on Dec 11, 2021

    @Wolvverine

    WSL2 has network, startup and installation issues - solution:

    Disable encryption and file compression:
    for %TEMP% - the swap file there by default location
    Or specify where to save in %USERPROFILE%\.wslconfig and disable there:

    [wsl2]
    ...
    swapFile = E:\\Temp\\swap.vhdx
    ...
    

    Disable encryption and compression on directories with distributions:

    %appdatalocal%\Packages\CanonicalGroupLimited.Ubuntu*
    %appdatalocal%\Packages\TheDebianProject.DebianGNULinux* 
    
  23. SharkyND commented on Jan 3, 2022

    @SharkyND
  24. lwbaqueros commented on Apr 24, 2022

    @lwbaqueros

    check this solution. It worked for me after trying all the above suggestions.
    Answer here.

  25. disberd commented on Aug 3, 2022

    @disberd

    Just leaving another potential solution when all solutions telling you to change resolv.conf and adding nameservers do not work.
    I have been trying to fix internet not working when behind corporate VPN for a long time without any success. After seeing some answers over the internet suggesting to use wsl-vpnkit I confirm that following the approach in https://github.com/sakai135/wsl-vpnkit I finally managed basically effortlessly to have internet connectivity in wsl2 even when over corporate VPN

    Edit: I just verified that I actually need both solutions for the system to work. I need to have the correct nameservers (the ones from my corporate network to have connectivity when behind VPN, and also some generic ones like google's dns as fallback for having it work outside of the VPN) on resolv.conf but I also need to enable the wsl-vpnkit as above otherwise I still can't connect to the internet.

  26. alexrsagen commented on Oct 9, 2022

    @alexrsagen

    Experiencing the same issue on Windows 11 build 22000.978 (edit: still happening on 22621.1413). I have isloated the problem and found a (bad) workaround. The issue is that the Hyper-V Default Switch used for WSL2 NAT networking selects/uses the wrong uplink interface, consistently.

    In addition to a few different VPN interfaces (not relevant), I primarily use the on-board Ethernet interface for networking. I also have a PCIe-connected Wi-Fi card installed, which WSL2 consistently uses as the uplink interface for reasons unknown to me.

    List of things I have attempted which made no difference at all and did not solve the issue:

    • Disable every network interface (Wi-Fi, VPNs) except the interface I want Hyper-V to use (Ethernet)
    • netsh int ip reset, netsh winsock reset
    • Uninstall Hyper-V, WSL and any related components, reboot, reinstall components
    • Stop the services cmdservice, hns, vmcompute, lxssmanager and re-start those services

    Workaround:

    • Disable every network interface except the PCIe Wi-Fi card
    • Connect to a Wi-Fi network

    It is surprising to me that there is no option to select desired uplink network interface for the Hyper-V Default Switch or NAT solution. This would solve the issue.

  27. microsoft-github-policy-service commented on Apr 4, 2024

    @microsoft-github-policy-service
    Contributor

    This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

    Thank you!

  28. alexrsagen commented on Apr 4, 2024

    @alexrsagen

    I am still experiencing the issue exactly as described. I'm sure many others also are. This issue should not be closed.

  29. hasahmed2 commented on Nov 20, 2024

    @hasahmed2

    I am still also experiencing the issue exactly #4731 (comment). I'm sure many others also are. This issue should not be closed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions