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

WSL version 2 has no network connectivity, version 1 works alright #11061

Open
1 of 2 tasks
PatrykSL opened this issue Jan 23, 2024 · 10 comments
Open
1 of 2 tasks

WSL version 2 has no network connectivity, version 1 works alright #11061

PatrykSL opened this issue Jan 23, 2024 · 10 comments
Labels

Comments

@PatrykSL
Copy link

PatrykSL commented Jan 23, 2024

Windows Version

Microsoft Windows 22H2 (19045.3930)

WSL Version

10.0.19041.3636 (WinBuild.160101.0800)

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 22.04.3 LTS (GNU/Linux 5.10.102.1-microsoft-standard-WSL2 x86_64)

Other Software

Docker Desktop (Windows)

Repro Steps

Install fresh Ubuntu from Windows Store after setting default wsl version to 2.

Expected Behavior

I was expecting networking to function normally.

Actual Behavior

No internet connection on any WSL version 2 ubuntu distribution. When falling back to version 1- everything works fine. I tried to change nameserver to 8.8.8.8 as read in some bug reports but that doesn't work.

Diagnostic Logs

No logs needed. Just no network connectivity. When using command "ping 8.8.8.8" it shows --- 8.8.8.8 ping statistics ---
380 packets transmitted, 0 received, 100% packet loss, time 394155ms

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.

@ghost ghost added the insufficientInformation Incomplete bug report label Jan 23, 2024
@ghost
Copy link

ghost commented Jan 23, 2024

If you add /logs and version information I will re-open and forward to the networking folks.

@ghost ghost closed this as completed Jan 23, 2024
@ghost ghost removed the insufficientInformation Incomplete bug report label Jan 23, 2024
@PatrykSL
Copy link
Author

WslLogs-2024-01-24_14-58-34.zip
As requested here are logs.

@PatrykSL
Copy link
Author

And just now I did add a WSL Version info. Please open the issue.

@ghost
Copy link

ghost commented Jan 25, 2024

Looks like you're using inbox WSL2. Do you get the same result if using WSL2 from the store?

@PatrykSL
Copy link
Author

PatrykSL commented Jan 26, 2024

@pmartincic it's the same issue:

wsl: Nie można utworzyć punktu końcowego sieci o adresie: „172.28.92.148”, przypisano nowy adres: „172.23.175.62”
PATRYK-PC:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
^C
--- 8.8.8.8 ping statistics ---
20 packets transmitted, 0 packets received, 100% packet loss
PATRYK-PC:~#

@chanpreetdhanjal
Copy link

Hi. Can you please collect networking logs by following the instructions below?
https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

@PatrykSL
Copy link
Author

WslNetworkingLogs-2024-01-30_09-59-55.zip
@chanpreetdhanjal Hello, logs you requested are attached to this message

@supahfox
Copy link

@pmartincic I'm having the same issue
These are my logs WslLogs-2024-01-31_12-05-41.zip

WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1

@alexrsagen
Copy link

alexrsagen commented Apr 4, 2024

Copying in my comment from #4731 to add context, a workaround and suggested solution.

I am experiencing the same issue on Windows 11 build 22000.3296 with WSL version 10.0.22621.2860 (WinBuild.160101.0800) and kernel version 5.10.102.1. I have isloated the problem and found a (bad) workaround. The issue is that the Hyper-V Default Switch used for WSL2 NAT networking selects/uses the wrong uplink interface, consistently.

In addition to a few different VPN interfaces (not relevant), I primarily use the on-board Ethernet interface for networking. I also have a PCIe-connected Wi-Fi card installed, which WSL2 consistently uses as the uplink interface (even when it is not connected to a Wi-Fi network) for reasons unknown to me.

List of things I have attempted which made no difference at all and did not solve the issue:

  • Disable every network interface (Wi-Fi, VPNs) except the interface I want Hyper-V to use (Ethernet)
  • netsh int ip reset, netsh winsock reset
  • Uninstall Hyper-V, WSL and any related components, reboot, reinstall components
  • Stop the services cmdservice, hns, vmcompute, lxssmanager and re-start those services

Workaround:

  • Disable every network interface except the PCIe Wi-Fi card (important step, otherwise the default gateway will be reached through the on-board Ethernet, but Hyper-V will still attempt to use the Wi-Fi card which will not work)
  • Connect to a Wi-Fi network

It is surprising to me that there is no option to select desired uplink network interface for the Hyper-V Default Switch or NAT solution. This would solve the issue.

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

4 participants