Skip to content
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

Mirrored networking fine at first but drops after only a few minutes #11369

Open
1 of 2 tasks
SergioSV96 opened this issue Mar 25, 2024 · 9 comments
Open
1 of 2 tasks
Labels

Comments

@SergioSV96
Copy link

Windows Version

Microsoft Windows [Versión 10.0.22631.3296]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.146.1-microsoft-standard-WSL2

Distro Version

Ubuntu 22.04

Other Software

Versión de WSL: 2.1.5.0
Versión de kernel: 5.15.146.1-2
Versión de WSLg: 1.0.60
Versión de MSRDC: 1.2.5105
Versión de Direct3D: 1.611.1-81528511
Versión DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Versión de Windows: 10.0.22631.3296

Repro Steps

ping google.com
ping 1.1.1.1
curl github.com
sudo apt update -y

Expected Behavior

I expected to get connection on this commands and get them to work like with NAT mode.

Actual Behavior

When I first start up my WSL distro, the internet connection works perfectly for a few minutes before the network completely stops working, getting "Temporary failure in name resolution" (with dnsTunneling=false) and "Unreachable host" (with dnsTunneling=true).

My settings are:

.wslconfig

[wsl2]
networkingMode=mirrored

wsl.conf

[boot]
systemd=true`

I have tried setting dnsTunneling=true and false and still got no internet connection on WSL, I have also tried several distros, Ubuntu 16, Ubuntu 22 and Kali Linux, same result. NAT always works fine, is just mirrored that doesn't work for me.

I have been trying several "solutions" posted on similar issues this past week, like the ones on these issues:

This problem seems to be a generalized issue, as noted on several other comments with the exact same problem as I do:

I am a software engineer myself but I don't have knowledge on advance networking so I am unable to debug this by myself, I am happy to try any solutions you can come by. Thank you a lot and I hope we can get this fixed.

Diagnostic Logs

Collect WSL logs for networking issues

File size was too big for GitHub (So I uploaded it to google drive instead)

https://drive.google.com/file/d/1qB4J8Whv0KRwuNvgNjydH99N2ZZ06E-R/view?usp=sharing

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@chanpreetdhanjal
Copy link

Please follow the networking diagnostic script. https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

It should create a folder like [WslNetworkingLogs-date_ver.zip]

@keith-horton
Copy link
Member

Thanks for the traces. Something has caused the vswitch to become misconfigured/broken, and packets are not correctly flowing to the Wi-Fi adapter on the host (that switch mapping is no longer there for some reason). Unfortunately, the errors that caused this broken switch state happened prior to when tracing was started.

We have not seen this before. Could you start the trace before starting WSL? Or before the repro state?
I do realize that will create a rather large trace - sorry about that.

Thanks!

@SergioSV96
Copy link
Author

Thanks for the traces. Something has caused the vswitch to become misconfigured/broken, and packets are not correctly flowing to the Wi-Fi adapter on the host (that switch mapping is no longer there for some reason). Unfortunately, the errors that caused this broken switch state happened prior to when tracing was started.

We have not seen this before. Could you start the trace before starting WSL? Or before the repro state? I do realize that will create a rather large trace - sorry about that.

Thanks!

Thank you for the help @keith-horton. For an unknown reason I can't even get WSL2 to have internet connection for the first few minutes when I start the powershell WSL network logging script beforehand. (I only have a few minutes of internet in WSL2 when I first bootup the computer, then after a few minutes I completely lose it and there is no way to get it back, not even wsl --shutdown, I have to completely reboot my whole computer. I did reboot it and start wsl, get to ping google.com, then start the logger, then the ping worked for a few minutes until it started to fail with Temporary failure in name resolution. I hope this traces may help you, please let me know if you need me to try anything else. Thank you!

Networking diagnostic traces: https://drive.google.com/file/d/1Fs8iK3OIn0bdKnDrpFt2NYAAIztDqJX-/view?usp=sharing

@SergioSV96
Copy link
Author

Is there any progress on this issue? I would love to make use of the mirrored feature, I am considering of just reinstalling the whole Windows 11 OS, I have tried reinstalling WSL2. changing distros, disabling IPV6 on windows, nothing seems to work... Thank you and sorry for the troubles @keith-horton @chanpreetdhanjal

@qgyhd1234
Copy link

I had the same issue, I downgraded my network card driver and then fixed the problem

@SergioSV96
Copy link
Author

I had the same issue, I downgraded my network card driver and then fixed the problem

Can you point me in the right direction here? How do I do that? Thank you a lot!

@flamecopper
Copy link

I have the same issue here.
There is ipv4 and ipv6 interface for the first 40 sec
I was able to ping google.com
After which, the ipv4 interface disappeared.
I have to reconnect to wifi to get this working again.

@qupada
Copy link

qupada commented Jun 19, 2024

I have what appears to be this issue too, but it predominantly only manifests after a change of networks on the host (including connecting or disconnecting a VPN), rather than any time-based trigger.

When broken I can still see changes to interfaces and routes in WSL by way of ip a and ip r that do match the host's ipconfig /all and route print, but all traffic stops passing.

Requires shutting down the VM with wsl.exe --shutdown and restarting to fix.

My .wslconfig:

[wsl2]
dnsTunneling=false
useWindowsDnsCache=false
bestEffortDnsParsing=false
networkingMode=mirrored
vmIdleTimeout=300000
dnsProxy=false
processors=12
kernelCommandLine=ipv6.disable=1
firewall=true

[experimental]
autoMemoryReclaim=gradual
sparseVhd=true

(re: the DNS options all being set to false here, I've set up a forwarder with split-horizon DNS inside the VM to better handle on/off VPN situations for work)

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.3737

Logs uploaded here, if it helps: https://app.box.com/s/kqy11c4lodiattx3rkui2vpwq10tesc8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants