-
Notifications
You must be signed in to change notification settings - Fork 835
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
No internet access after reboot #3438
Comments
Try to add DNS server IP address with: |
Output:
Even with sudo i can't |
@heihachi88 What's the output of |
both files empty... what the hell, yesterday it worked after reboot, approx after 1 hour. Nothing new i installed. |
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. |
Files didn't exist. Are you sure it's not 18.04 issue? Are you using 18.04 yourself? |
Yes, I'm using 18.04 but I'm using build 17134. Can't you upgrade your Windows 10? |
How can i upgrade build? I must switch to beta or something? I just migrated from MacOS (used it last 6 years) |
If it's your computer this should work If it doesn't appear on Windows Update you can also use the Updater Assistant or create a installation media: |
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? |
Ended it this way:
-c parameter was missing from @Biswa96 answer, now my DNS is working, but still, why DOES it happening? |
You have problems with the network adapter, WSL is not at all .WSL uses WinSocket |
@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. |
@heihachi88 No, I missed the nameserver word. BTW, the resolv.conf file should be automatically created. And it's a symbolic link to |
@Biswa96 I can't delete not existing file, both files you mentioned didn't exist, before i manually injected them and |
@voskrese your instructions helped me - thanks! Weird that this became a problem after upgrading to build 17730. I had no issues with DNS prior to upgrading, and pinging via IP worked fine. |
@voskrese is reboot necessary? I'll try it next time it won't resolve. |
@heihachi88 This is a recommendation, once reboot to have entered new settings, I think is not the same and the problem |
@voskrese tried your changes, even rebooted 🤣 , but still no /etc/resolv.conf just WTF is this. |
Try to recover resolv.conf again (uninstalling the app and reinstalling?) and just after waking up PC from sleep get some logs following this: |
I've already reinstalled Ubuntu 18.04 twice, maybe it's hardware? Can i just hardcode this /etc/resolv.conf, so it won't regenerate by WSL all the time. When last time i had correct DNS in WSL, it had following entries:
|
Please post the logs. It could be your internet configuration or some permission problem.
|
@heihachi88 What service uses resolv. conf in WSL? No, only utilities working with the network, by custom |
@heihachi88 Well, if you want to deal with the network in more detail, here everything is described
Check network card settings
Add DNS to the Resolvconf utility added
to
|
Alternatively, firewall may block outbound connection WINDOWS cmd.exe
WSL bash.exe
ON firewall
|
Windows defender you mean? |
I traced the process that is responsible for going into the WSL network, apparently as a layer https://github.com/henrypp/simplewall под названием PICO |
After these steps my problem was fixed. |
Looks like there is some problem with WSL networking on build 18945. After booting, the WSL virtual interface got the following address:
On the windows side, the WSL interface was:
I think the problem is that the default gateway on the linux side should be If I change the netmask to
I guess that after the upgrade the netmask on the Windows side changed and the virtual DHCP server is providing the wrong one for the WSL host (may be it was hardcoded). Or vice-versa. Anyway the workaround is:
|
If you modified, moved or compressed the temp folder, look at #5437 for the solution |
source: stackoverflow
|
Someone recommended this to me for alleviating a (different but probably related) wsl2 internet connectivity issue: |
I fix this with windows 11: |
This is what helped to me ... I am having WSL2 and using VPN (Cisco Anyconnect) to connect to my company network. WSL2 VM is configured with INTERNAL type of connection of virtual switch be default, which can be the main reason for issues, so we could think about to change to EXTERNAL.
Not sure what this exactly does, and how to do it other way and permanently, but it works. |
If you can ping web pages from the linux terminal you can try turning off all your firewalls or antivirus. It worked for me. |
I was able to solve this issue with the following steps
|
This bug happened to me after installing VirtualBox 6.1.34 - WSL network stopped working.
Check if you can ping the router gateway in WSL:
(optionally) Check the content of
Create
In Powershell:
In WSL:
Works even after the system reboot, no However, the reason why this issue happened is still unclear. |
i was also having same issue, here's how i have fixed netsh advfirewall set allprofiles state off then press enter |
1 similar comment
i was also having same issue, here's how i have fixed netsh advfirewall set allprofiles state off then press enter |
What are the security risks of doing that? |
Looks like it's disabling your windows firewall. Wouldn't recommend |
He shouldn't disable firewall. Instead he should use linux in vm |
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..... |
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. Note: I notice this problem happens sometimes after restarting computer due to windows update (cross finger) |
You may still have issues after that so use your Default Gateway (by default 192.168.0.1) in |
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 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..... |
Nothing helped. I deleted wsl and now i can't even open google. I just don't have internet connection. Please help |
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... |
Hi folks, we have put out a new update that aims to address networking issues in WSL. In your 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 |
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. |
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:Then i check:
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?
The text was updated successfully, but these errors were encountered: