Skip to content

No internet access after reboot #3438

Closed

Description

@avxkim

OS Version: 10.0.16299 Build: 16299
Ubuntu 18.04 from microsoft store

After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:

ping: google.kz: Temporary failure in name resolution

Then i check:

cat /etc/resolv.conf

File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?

Activity

  1. Biswa96 commented on Aug 4, 2018

    @Biswa96

    Try to add DNS server IP address with: echo 8.8.8.8 > /etc/resolv.conf.

  2. avxkim commented on Aug 4, 2018

    @avxkim
    Author

    sudo echo 8.8.8.8 > /etc/resolv.conf

    Output:

    bash: /etc/resolv.conf: Permission denied

    Even with sudo i can't

  3. onomatopellan commented on Aug 4, 2018

    @onomatopellan

    @heihachi88 What's the output of ll /etc/resolv.conf and ll /run/resolvconf/resolv.conf ?

  4. avxkim commented on Aug 4, 2018

    @avxkim
    Author

    both files empty... what the hell, yesterday it worked after reboot, approx after 1 hour. Nothing new i installed.

  5. onomatopellan commented on Aug 4, 2018

    @onomatopellan

    Empty or file did not exist? I was interested in the file permissions. This is what it looks like:.

    onoma@DESKTOP:~$ ll /etc/resolv.conf
    lrwxrwxrwx 1 root root 29 May 11 21:15 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
    onoma@DESKTOP:~$ ll /run/resolvconf/resolv.conf
    -rw-r--r-- 1 root root 147 Aug  4 20:28 /run/resolvconf/resolv.conf

    Seems file got corrupted or something. I would uninstall the Ubuntu18.04 app and reinstall it to see if it happens again.

  6. avxkim commented on Aug 4, 2018

    @avxkim
    Author

    Files didn't exist.

    Are you sure it's not 18.04 issue? Are you using 18.04 yourself?

  7. onomatopellan commented on Aug 4, 2018

    @onomatopellan

    Yes, I'm using 18.04 but I'm using build 17134. Can't you upgrade your Windows 10?

  8. avxkim commented on Aug 4, 2018

    @avxkim
    Author

    How can i upgrade build? I must switch to beta or something? I just migrated from MacOS (used it last 6 years)

  9. onomatopellan commented on Aug 4, 2018

    @onomatopellan
  10. avxkim commented on Aug 5, 2018

    @avxkim
    Author

    Updated to 1803, same picture. After sleep / reboot, no resolv.conf, i even reinstalled Ubuntu 18.04

    How to manually run that resolv script in WSL?

  11. avxkim commented on Aug 5, 2018

    @avxkim
    Author

    Ended it this way:

    sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
    sudo bash -c 'echo "nameserver 8.8.4.4" >> /etc/resolv.conf'
    
    exit
    

    -c parameter was missing from Biswapriyo Nath (@Biswa96) answer, now my DNS is working, but still, why DOES it happening?

  12. MVoz commented on Aug 5, 2018

    @MVoz

    You have problems with the network adapter, WSL is not at all .WSL uses WinSocket

  13. avxkim commented on Aug 5, 2018

    @avxkim
    Author

    voskrese if i had a problem with the network adapter, then in windows i would have the same problem, but on Windows i have no issues related to DNS.

  14. Biswa96 commented on Aug 5, 2018

    @Biswa96

    @heihachi88 No, I missed the nameserver word. BTW, the resolv.conf file should be automatically created. And it's a symbolic link to /run/resolvconf/resolv.conf. Try to delete that /etc/resolv.conf and exit from wsl.exe. Then rerun wsl.exe and check if that file/symbolic link will automatically created or not.

  15. avxkim commented on Aug 5, 2018

    @avxkim
    Author

    Biswapriyo Nath (@Biswa96) I can't delete not existing file, both files you mentioned didn't exist, before i manually injected them and exit shell, then relaunch again.

  16. 40 remaining items

  17. YevheniiPokhvalii commented on May 28, 2022

    @YevheniiPokhvalii

    This bug happened to me after installing VirtualBox 6.1.34 - WSL network stopped working.
    In order to be able to use VPN beside my home network (the trick with 8.8.8.8 did not work here), I added my router gateway IP as a nameserver to the WSL config:

    > netsh interface ip show config "WiFi"
    
    Configuration for interface "WiFi"
        DHCP enabled:                         Yes
        IP Address:                           192.168.0.106
        Subnet Prefix:                        192.168.0.0/24 (mask 255.255.255.0)
        Default Gateway:                      192.168.0.1
        Gateway Metric:                       0
        InterfaceMetric:                      50
        DNS servers configured through DHCP:  192.168.0.1
        Register with which suffix:           Primary only
        WINS servers configured through DHCP: None
    

    Check if you can ping the router gateway in WSL:

    $ ping -c1 192.168.0.1
    PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
    64 bytes from 192.168.0.1: icmp_seq=1 ttl=63 time=2.49 ms
    
    --- 192.168.0.1 ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 2.487/2.487/2.487/0.000 ms
    

    (optionally) Check the content of /etc/resolv.conf. You will see a description there:

    $ cat /etc/resolv.conf
    # This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
    # [network]
    # generateResolvConf = false
    nameserver 172.24.208.1
    

    Create /etc/wsl.conf in WSL:

    $ cat /etc/wsl.conf
    [network]
    generateResolvConf = false
    

    In Powershell:

    wsl --shutdown
    

    In WSL:

    sudo bash -c 'echo "nameserver 192.168.0.1" > /etc/resolv.conf'
    

    Works even after the system reboot, no chattr is required.

    However, the reason why this issue happened is still unclear.

  18. VarunBanka commented on Jul 12, 2022

    @VarunBanka

    OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store

    After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:

    ping: google.kz: Temporary failure in name resolution
    

    Then i check:

    cat /etc/resolv.conf
    

    File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?

    i was also having same issue, here's how i have fixed
    open windows PowerShell as admin and type the following

    netsh advfirewall set allprofiles state off

    then press enter
    restart
    hope it helps

  19. VarunBanka commented on Jul 12, 2022

    @VarunBanka

    OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store

    After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:

    ping: google.kz: Temporary failure in name resolution
    

    Then i check:

    cat /etc/resolv.conf
    

    File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?

    i was also having same issue, here's how i have fixed
    open windows PowerShell as admin and type the following

    netsh advfirewall set allprofiles state off

    then press enter
    restart
    hope it helps

  20. jikuja commented on Jul 13, 2022

    @jikuja

    OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store
    After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:

    ping: google.kz: Temporary failure in name resolution
    

    Then i check:

    cat /etc/resolv.conf
    

    File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?

    i was also having same issue, here's how i have fixed open windows PowerShell as admin and type the following

    netsh advfirewall set allprofiles state off

    then press enter restart hope it helps

    What are the security risks of doing that?

  21. jjcf89 commented on Jul 14, 2022

    @jjcf89

    What are the security risks of doing that?

    Looks like it's disabling your windows firewall. Wouldn't recommend

  22. VarunBanka commented on Jul 14, 2022

    @VarunBanka

    OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store
    After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:

    ping: google.kz: Temporary failure in name resolution
    

    Then i check:

    cat /etc/resolv.conf
    

    File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?

    i was also having same issue, here's how i have fixed open windows PowerShell as admin and type the following
    netsh advfirewall set allprofiles state off
    then press enter restart hope it helps

    What are the security risks of doing that?

    He shouldn't disable firewall. Instead he should use linux in vm

  23. VarunBanka commented on Jul 14, 2022

    @VarunBanka

    OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store
    After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:

    ping: google.kz: Temporary failure in name resolution
    

    Then i check:

    cat /etc/resolv.conf
    

    File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?

    i was also having same issue, here's how i have fixed open windows PowerShell as admin and type the following
    netsh advfirewall set allprofiles state off
    then press enter restart hope it helps

    What are the security risks of doing that?

    There are major security ricks of doing that so it's not recommended but what I would recommend is using using linux on vm. Fell free to contact me for any errors or anything.....

  24. bayangan commented on Nov 10, 2022

    @bayangan

    I changed nameserver in /etc/resolv.conf using IP i found from public dns, replacing the usual google dns 8.8.8.8 or 1.1.1.1

    No need to restart wsl or computer.
    To test the connection can simply run
    $ composer diagnose
    or
    $ sudo apt update
    or
    ping reknown domain
    $ ping google.com

    Note: I notice this problem happens sometimes after restarting computer due to windows update (cross finger)

  25. YevheniiPokhvalii commented on Nov 11, 2022

    @YevheniiPokhvalii

    bayangan

    You may still have issues after that so use your Default Gateway (by default 192.168.0.1) in /etc/resolv.conf instead of Google public DNS or any other public DNS.

  26. VarunBanka commented on Nov 13, 2022

    @VarunBanka

    bayangan

    You may still have issues after that so use your Default Gateway (by default 192.168.0.1) in /etc/resolv.conf instead of Google public DNS or any other public DNS.

    I've tried it but it needs to be changed after every restart, however I was able to fix it by:

    opening the windows PowerShell as admin and typing the following

    netsh advfirewall set allprofiles state off

    then pressing enter
    restarting

    But there are major security ricks of doing that so it's not recommended but what I would recommend is using using linux on vm instead.....

  27. CaretakerBlayze commented on Aug 11, 2023

    @CaretakerBlayze

    Nothing helped. I deleted wsl and now i can't even open google. I just don't have internet connection. Please help

  28. bernardosts commented on Aug 25, 2023

    @bernardosts

    Still with the same issue. Somehow the network between the host and the WSL VM is broken after some actions. With me happens always when I need to connect to any VPN. Just after vpn connection everything works fine. When I disconnect from the vpn wsl vm can't access the internet anymore. I have tried all those commands to restart the windows network stack, wsl vm reboot, restart the wsl system service. Nothing works at all, except a windows reboot. This is really annoying. I hope that you guys figure this out in the near future. I would hate to miss the integrated experience of using WSL (and turn to an VM) because of this...

  29. craigloewen-msft commented on Sep 19, 2023

    @craigloewen-msft
    Member

    Hi folks, we have put out a new update that aims to address networking issues in WSL. In your .wslconfig file you can set experimental.networkingMode=mirrored, as well as some other key settings that should improve your network compatibility, and add support for IPv6! Please try them out and let us know what you think.

    More info on this release and the changes can be found here in the blog post.

    Please note: You need to be on a Windows Insiders version to use the new networking settings (Any channel of Windows Insiders will do, including release preview). If you see the "These are not supported" messages it means that your current Windows version doesn't have support, and you will need to upgrade. These features will eventually be coming to Windows 11 22H2.

    Please see megathread for DNS issues in WSL: #8365

  30. OneBlue commented on May 14, 2024

    @OneBlue
    Collaborator

    Hi ! Please try the latest networking features that we've added in WSL. Those should greatly improve compatibility with VPN's.

    If the issue still remains, please reopen this issue.

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