Windows 10: WSL 2 apt says network is unreachable

Discus and support WSL 2 apt says network is unreachable in Windows 10 Network and Sharing to solve the problem; I just set up a fresh install of Windows 10 on a brand new disk. I then followedthis official guide for setting up WSL 2, and installed the latest... Discussion in 'Windows 10 Network and Sharing' started by chimpman252, Aug 6, 2020.

  1. WSL 2 apt says network is unreachable


    I just set up a fresh install of Windows 10 on a brand new disk. I then followedthis official guide for setting up WSL 2, and installed the latest Ubuntu 20.04 from the Microsoft Store. With this launching correctly, the first thing I tried was a `sudo apt update` so that I could start installing software, but this failed saying "Network is unreachable":

    WSL 2 apt says network is unreachable 46b7566a-54e6-48bb-aa33-e7887ba6cf91?upload=true.png


    I browsed the web for a solution and saw work that IPv6 could be the culprit, but even after disabling IPv6 on the WSL adapter and my ethernet adapter, the problem persists.


    I don't understand why installing WSL with the official instructions on a brand new install of Windows 10 would have any issues. I am unable to install any software in WSL due to this issue.

    :)
     
    chimpman252, Aug 6, 2020
    #1
  2. RogerDV Win User

    How to configure WSL Ubuntu (or any WSL distro) to use a NAT virtual network

    I've installed WSL Ubuntu on my Windows 10 laptop and it is running fine.

    However, it is not able to access anything on the Internet at port 80 and so forth. I cannot use apt package installer to install any software at all.

    My host laptop Windows environment has no problem, of course, with Internet access.

    Info I've gleaned is that WSL is being blocked by a firewall. Am using Kaspersky as mandated by internal corporate policy. I've added an exception rule for WSL but that has no positive effect on the problem. Additional info I've gleaned is that others have
    had same experience - unfortunately this doesn't allow programs running in WSL virtualization any access out to the public Internet.

    The latest info I could find is that WSL just flat out won't work with several prominent Windows firewall apps unless they are disabled of even uninstalled (not a possible option for me).

    So I followed these instructions and created a NAT virtual network:
    Set up a NAT network


    Got that created with no problem and it shows up as eth3 interface on my laptop.

    Remaining instructions at the above link talk about how to get Docker for Windows and other Hyper-V VMs to use this NAT. However, I can't find anything that instructs how to setup WSL to do so. WSL evidently can't be managed in same manner as other Hyper-V
    VMs.

    Presumably the iptables or ip command to setup routing could be used to do this in the Ubuntu Linux environment, but that is where am appealing for help from anyone that knows how to do this in respect to WSL.
     
    RogerDV, Aug 6, 2020
    #2
  3. NickJP Win User
    Cannot upgrade installed distros in WSL to version 2

    After installing the Win10 2004 build 19041 update (running winver shows "version 2004 (OS build 19041.388)", I've tried to upgrade a couple of installed distros I had in WSL version 1 to WSL version 2 following the instructions at https://docs.microsoft.com/en-us/win.../install-win10. All the steps in the instructions compete successfully, up to the point where I try to change the WSL version of one of the installed distros to 2 at which point I see the messages below:

    Code:
    I have enabled the Virtual Machine Platform feature (it shows as on with a tick against it in Control Panel Windows features), Intel-vt virtualization is enabled in the BIOS, and running msinfo32 shows, at the bottom of the system summary listing:

    Code:
    I also tried installing another distro with the WSL default version set to 2, but attempting to launch it shows the error:

    Code:
    Any suggestions on how to get around this problem? From what I've read, WSL2 gives worthwhile speed increases over WSL1, and so is worth using if I can get it to work.
     
    NickJP, Aug 6, 2020
    #3
  4. M4v3r1ck Win User

    WSL 2 apt says network is unreachable

    NAS unreachable

    Control Panel > Show all > Credential Manager and select tab Windows Credentials.

    If you can't find the tab, just let me know and I'll post a screen cap for you here!

    Here you go:

    1. Control Panel > All Control Panel Items

    WSL 2 apt says network is unreachable [​IMG]


    2. Credential Manager

    WSL 2 apt says network is unreachable [​IMG]


    3. Windows Credentials > Select Add a Windows Credentials

    WSL 2 apt says network is unreachable [​IMG]


    4. Enter the user credentials for your NAS / USERNAME & PASSWORD:

    WSL 2 apt says network is unreachable [​IMG]


    Enter \\NameOfYourNAS
    Enter your username for your NAS
    Enter your password for your NAS

    Cheers
     
    M4v3r1ck, Aug 6, 2020
    #4
Thema:

WSL 2 apt says network is unreachable

Loading...
  1. WSL 2 apt says network is unreachable - Similar Threads - WSL apt says

  2. apt not working wsl

    in Windows 10 Gaming
    apt not working wsl: wsl have internet access but apk not connecting https://answers.microsoft.com/en-us/windows/forum/all/apt-not-working-wsl/3b25b2b2-4295-495c-ac94-2cef4cb75360
  3. apt not working wsl

    in Windows 10 Software and Apps
    apt not working wsl: wsl have internet access but apk not connecting https://answers.microsoft.com/en-us/windows/forum/all/apt-not-working-wsl/3b25b2b2-4295-495c-ac94-2cef4cb75360
  4. apt not working wsl

    in Windows 10 Network and Sharing
    apt not working wsl: wsl have internet access but apk not connecting https://answers.microsoft.com/en-us/windows/forum/all/apt-not-working-wsl/3b25b2b2-4295-495c-ac94-2cef4cb75360
  5. Network Location "Unreachable" but it's not really...

    in Windows 10 Software and Apps
    Network Location "Unreachable" but it's not really...: I have a PC and a media server, both using Windows 11. I have the media server as a network location and also as a mapped network drive on the PC. If I click on it, it works absolutely fine without issue. However, if I turn off or restart my PC, the icon gets an X over it and...
  6. Network Location "Unreachable" but it's not really...

    in Windows 10 Gaming
    Network Location "Unreachable" but it's not really...: I have a PC and a media server, both using Windows 11. I have the media server as a network location and also as a mapped network drive on the PC. If I click on it, it works absolutely fine without issue. However, if I turn off or restart my PC, the icon gets an X over it and...
  7. WSL 2

    in Windows 10 BSOD Crashes and Debugging
    WSL 2: I want to make use of WSL 2 feature with the new update of Windows version 2004 , in order to use WSL 2 i need to enable Virtualization in my pc bios settings. So when i enable virtualization my windows starts lagging and all the animations of scrolling etc etc lags...Please...
  8. Getting slow speed on apt get in Kali WSL 2 while Ubuntu WSL 2 works a lot better. And...

    in Windows 10 Ask Insider
    Getting slow speed on apt get in Kali WSL 2 while Ubuntu WSL 2 works a lot better. And...: Background: I am a noob, so sorry for any technical details I get wrong. I already had Ubuntu installed on WSL1, and it was pretty slow. Then I upgraded it to WSL2 and it got super fast. I needed Kali for learning pentesting and had a terrible experience while trying to dual...
  9. WSL 1 to WSL 2 Upgrade

    in Windows 10 Support
    WSL 1 to WSL 2 Upgrade: Been using Windows Subsytem for Linux for some time. How do I get it upgrade to WSL 2. 132527
  10. Devices on my local network unreachable

    in Windows 10 Network and Sharing
    Devices on my local network unreachable: From a PC (called PC1 later on; running W10), I do not see other PCs or multimedia boxes connected on my local network. Using \\192.xx.yy.zz doesn’t work. From a W10 tablet PC (called PCt later on), I see other connected devices: Dune HD and PC1. From PCt I can even...