-
Notifications
You must be signed in to change notification settings - Fork 847
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 network connection in any distribution under WSL 2 #5336
Comments
Try network reset or allow in firewall. |
Can you be any more specific about how to do either of those things? I'm new to Windows (just migrating back from macOS). |
Try something like |
$ ping 216.58.192.164
connect: Network is unreachable |
See #4731 |
Ok, looks like this is a duplicate of #4731, is that what you mean @onomatopellan? |
Hard to say. There are more threads with "Network is unreachable" where people tries to solving it in different ways like in #4275 (comment) It depends of your networking configuration, if you are using some VPN, proxy configuration... Try any of the solutions of those threads and if nothing work the best you can do is post a link to a networking trace so the team can take a look at it. |
Thanks @onomatopellan, I don't have any special networking configuration, so will post a tracr using the feedback hub. |
I’ve shared my network trace: https://aka.ms/AA8mo2v WSL1 works fine, WSL2 does not. Downgrading from WSL2 to WSL1 restores connectivity. |
Maybe related to #5286 ? |
@mrausnadian, 'my account doesn't have access to that feedback', can you please summarise the content of that link? |
I disabled the Hyper-v feature. The network backs to normal. |
How did you do it? If I disable it in windows features then wsl just doesn't run "The request is not supported". |
@habamax commented on Jun 10, 2020, 7:38 PM GMT+7:
Convert the linux to WSL 1. |
How does it solve the issue with wsl2? PS, wanted to use wsl2 but it is not ready. |
You need to ensure the virtual machine platform is enabled, Check the #4840 |
Well, I can start wsl2 but again there is no internet connection while wsl1 has it. Anyway, thanks, will continue using wsl1. |
@duncanmmacleod Did you ever solve this? I'm experiencing the same exact issue on 19041.329. I hardly consider using WSL 1 a reasonable solution. I'm also finding that setting the name server and adding |
No, I submitted the relevant feedback reports to Microsoft and am waiting for a response. |
I've given up on WSL completely. WSL 2 has network adaptor issues and WSL 1 has no docker integration. It's amazing that despite having a fully dockerized environment, I cannot work on Windows. |
In my case it was the firewall of my antivirus suite that is blocking the connection. Try disabling your antivirus' firewall (or the whole suite) and retry the connection. The bridge network via your primary physical connection that provides external network access to the WSL guest should work out of the box. On my case it is norton's firewall that is blocking the connection. It is quite hard to see since there are no notifications that the connection is being blocked. I just added at WSL guest hardware / MAC address via the device trust list. |
Similar issue here: after upgrade to ver 2004 and wsl 2 - internet (or network) non-functional in any distro.
My network config is very simple : plain GB ethernet and (disabled) wi-fi; no any 3rd party network or "security" stuff. |
OR
|
Tried, did not work.. |
Hey all, Please try this if wsl2's internet stops working
The solution by above by Ziauddin02 resolves it in script form :) |
Worked! also swapping out 8.8.8.8 to any other (eligible?) DNS seems to work. Though, if I have set my Windows to use a different one, would it cause any problems? |
Hello! I have the same problem after KB5023696 update. Is there any official microsoft ticket I can watch? Looks like this bug is critical |
Hi, could you please provide me the steps |
Hi, I just changed the DNS resolver in the file /etc/resolv.conf, and it worked for me.
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /># [network]
# generateResolvConf = false
nameserver 8.8.8.8 https://learn.microsoft.com/en-us/answers/questions/853140/wsl-2-internet-connectivity-is-gone |
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. |
I am also facing this issue and have tried most of the solutions like changing nameserver in resolv.conf as well as commands to reset stuff but no luck - Not only this but previously too faced issues with wsl which resulted in re-imaging the system but it's too time consuming to keep on debugging network errors and try stuff rather than concentrate on my actual tasks - time to convince my lead and manager to maybe move away from Wsl - so many people are facing these issues , but still no clear solution - not everyone is a network wizard to resolve issues like these |
Given the exchange above, I am publishing what I did to solve the isue. The key is an action in Hyper-V manager to change networking options. Install Ubuntu with an IP in external network on WSL2 V2-summary.pdf |
@vishwa3 - try this - may your Windows Firewall blocks DNS. #5336 (comment) |
Thanks @Elektronenvolt and @jn-simonnet for your inputs - I managed to resolve the issue . I was on a corporate network with McAfee installed in my system - Raised a ticket with cyber security and got rid of it - The IT team had inadvertently pushed McAfee on my system and soon enough I started facing this issue-once McAfee was gone , WSL2 started pinging again , maybe I was unnecessarily critical of WSL2 though it has caused me issues before - Time to get back to my pending stories now 👍 |
This solved my issue! Although i did not change anything, the network connectivity just stopped working, i was this close to reinstalling my wsl :D |
Thanks @marvinhinz - My issue is resolved - please check - |
These new networking features are now available on the latest version of Win11 22H2! Please make sure you're on the latest build to get these features, you can do that by clicking "Check for Updates" in Windows settings. You can check you have the right build by either ensuring you have KB5031354 installed, or run |
We have updated the troubleshooting document for name resolution. There are configuration which can break DNS name resolution from a WSL container, and there is a work around for an HNS issue. This information can be found here: https://github.com/MicrosoftDocs/WSL/blob/main/WSL/troubleshooting.md#troubleshooting-dns-in-wsl |
Doing these solved my problem: Select your pc, open Virtual Switch Manager Select WSL Set to external network Select the network card the traffic runs through Then login to wsl2 terminal and configure an IP address. E.g.
This is where i found it: https://stackoverflow.com/a/62438375/10853017 |
How did this turn into an issue about DNS? |
The reported failures in DNS resolution is a result of the problem - not the cause... |
Can confirm this statement. In our case Windows Defender blocked incoming DNS for the WSL network adapter. In other cases here VPN clients caused DNS troubles, e.g. |
Only solution that worked for me (https://superuser.com/a/1671057/1662386): Add the following to your <windows_user_profile>/.wslconfig:
Run wsl --shutdown from PowerShell then restart WSL |
I believe you need to include |
I got
Any idea? |
Mirrored Mode requires Windows 11 22H2 and higher. And the optional component "Virtual Machine Platform" is installed. Thanks! |
oh, nice ... a version-locked feature and the the version it is locked to just so happens to be the most ad-ridden one of all time. I see the marketing department finally took full control. Well. It really "is" time to switch / virtualize / pirate winblows, then. Who would've thought. |
Well, I would call it 'dependency' 🧐But, what is 'version locked' in this case? Don't see it... |
我参考此链接得以在WSL2下恢复网络 https://learn.microsoft.com/zh-cn/windows/wsl/troubleshooting 1.允许 DNS 数据包共享访问的 HNS 防火墙规则可能无效,引用以前的 WSL 接口标识符。 这是 HNS 中的一处缺陷,在最新的 Windows 11 版本已得到修复。 在早期版本中如果发生这种情况,虽然不容易发现,但有一个简单的解决方法: 2.停止 WSL wsl.exe –shutdown 3.删除旧的 HNS 防火墙规则。 大多数情况下,此 Powershell 命令应正常工作: Get-NetFirewallRule -Name "HNS*" | Get-NetFirewallPortFilter | where Protocol -eq UDP | where LocalPort -eq 53 | Remove-NetFirewallRule 4.移除所有 HNS 终结点。 注意:如果使用 HNS 管理其他容器(例如 MDAG 或 Windows 沙盒),则还应停止这些容器。 hnsdiag.exe delete all 5.重新启动或重启 HNS 服务 Restart-Service hns #如果重启hns报错,需要依赖项,可重启电脑解决 6.重启 WSL 后,HNS 将创建新的防火墙规则,并正确面向 WSL 接口。 C:\Users\Administrator>wsl -l -v
如上ping 8.8.8.8可以通 |
本人系统环境为windows 10.0.19044 希望能帮助到你!!! |
In my case, this config fix the problem: [wsl2] |
Before use name like eth0 of device with internet access - check device name by:
A working solution on mode bridged On windows brand new virtual device (enable features of hyper-v in cli):
make by:
And finally firewall, yep firewall ( your $clsid will be different - Name) :
On windows in file at c:/Users/<name_of_user>/.wslconfig
|
Environment
Steps to reproduce
I have installed WSL 2 on a new Windows 10 Education machine managed by my employer (university) following the online instructions. Whenever I create a new distribution using WSL version 2 I have no network connection.
Gist of strace here: https://gist.github.com/duncanmmacleod/4a69a363bf990c3a0dead811b22ce6d5
If I use
wsl --set-version
to roll back the distribution to WSL 1 I get a network connection just fine.Expected behavior
New distributions on WSL 2 have a working network connection out-of-the-box.
Actual behavior
See above
Thanks, sorry if this is a duplicate of an existing issue (I surely can't be the only one...)
The text was updated successfully, but these errors were encountered: