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

WSL2 network unpredictably working or not #8620

Closed
1 of 2 tasks
mhechthz opened this issue Jul 16, 2022 · 12 comments
Closed
1 of 2 tasks

WSL2 network unpredictably working or not #8620

mhechthz opened this issue Jul 16, 2022 · 12 comments

Comments

@mhechthz
Copy link

mhechthz commented Jul 16, 2022

Version

Microsoft Windows [Version 10.0.22000.795]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

Well, the behaviour is not reproducible.

The WSL2 network connecivity is sometimes available and sometimes not. Sometimes means, that it works on one day and doesn't work the other day. If it doesn't work I can restart the WSL2 but nothing changes. I also restarted the computer without any change, but not very often ( one or two times). I check this every time directly after booting the computer, I a usually no other software runs.

I recorded this for a while: WSL2.pdf - I never changed something at the configuration of the computer. The behaviour was the same with Windows 10. The computer network is always available.

The parallel running WSL1 as well as the WSL1 I used before updating to WSL2 never had any problems with connectivity.

Expected Behavior

Starting computer - starting WSL2 (Ubuntu) - network available without any further action.

Actual Behavior

Starting computer - starting WSL2 (Ubuntu) - network unreproducibly not available without any chance to figure out why.

Diagnostic Logs

Don't know which logs to provide.

@pmartincic
Copy link
Collaborator

When you're able to reproduce it: /logs

@ghost
Copy link

ghost commented Jul 19, 2022

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

@mhechthz
Copy link
Author

mhechthz commented Jul 22, 2022

This is a log where WSL2 has no connection:
WslLogs-2022-07-22_10-08-09_not-working.zip

This is a log where connection is ok:
WslLogs-2022-07-24_07-30-09_working.zip

@ghost ghost removed the needs-author-feedback label Jul 22, 2022
@jwhett
Copy link

jwhett commented Aug 21, 2022

I've also experienced this issue today/yesterday. Issue persists PC and service (LxssManager) restarts.

It's more of a sporadic networking issue instead of being fully up or down. Here are the logs with a failure. I consistently hit issues when installing/upgrading doom emacs due to the number of dependencies it clones. I've also had issues during GraphQL queries to GitHub and a number of other things so it doesn't seem to be something specific with doomemacs.

More info on the doom failures:

  • Failures are not consistent with a particular repo.
  • Errors returned are indicative of networking issues during the cloning phase of a dependency.
  • See this issue for more detail on the error itself.

I cannot replicate this issue on any other non-WSL device on my network nor on the Windows host running this WSL instance.

Ubuntu 22.04 - Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

The iteration time is somewhat long (between 5-15 minutes), but I'm happy to try and collect more information as needed.

Thank you,
Josh

@tonywildey-valstro
Copy link

Just want to add that we are seeing this exact behaviour as exhibited above across multiple WSL2 environments

@mhechthz
Copy link
Author

New insight: The Windows 11 sandbox also has no connectivity if WSL2 has no connectivity and has connectivity if WSL2 has connectivity. IP addresses or ranges are different.

Furthermore I did some statistics on WSL2:
image

except for 172.30.x.x all assigned addresses belong either to never or to always connected.

@NotTheDr01ds
Copy link

Is there any VPN service in play? Anything automated that is happening with some other software running on the machine that might use a VPN connection in the background?

@mhechthz
Copy link
Author

No, I'm only using Windows Defender.

@NotTheDr01ds
Copy link

@mhechthz So the issue has been going on for some time - Ouch. I know those are frustrating. As I mentioned in #9088, I'll try to noodle on this some, but as caveated there, I don't have a high success rate with helping out with networking issues. In general, I think I'm fairly good with troubleshooting WSL, as I have some 30,000 rep on Stack Exchange sites in WSL questions - Just not-so-much on the networking side.

I'm going to throw my hail-Mary first -- Have you tried updating to a recent WSL release (Preview)?

Other than that, some random questions to see if we can figure it out (and just let me know if and when you'd like for me to stop 😉):

  • Is this a home or corporate/university network?

except for 172.30.x.x all assigned addresses belong either to never or to always connected

That's got to be a clue (or a high-level of coincidence). Related:

I can restart the WSL2 but nothing changes

How are you restarting WSL2? A wsl --shutdown (or VMIdleTimeout (see #8659) here is the only thing that will "hang up" the network. After a wsl --shutdown, the WSL2 VM should obtain a new IP on restart. Should be easier than a full-reboot to try a sampling of addresses/subnets this way.

@NotTheDr01ds
Copy link

@tonywildey-valstro

across multiple WSL2 environments

By that, I'm assuming that you mean multiple PCs? And based on that, I'm assuming a corporate/university environment? Just looking for any common-denominators here. Any additional information you can provide (Windows versions, WSL versions, kernels, wsl --shutdown behavior (see my previous comment), etc. might help narrow down the issue.

@HouzuoGuo
Copy link

Just wanna throw another data point here - I've only recently upgraded from WSL1 to WSL2 last night on this home desktop computer. WSL1 never had any network reliability issues but now on WSL2 I'm constantly running into this kind of errors when installing doom-emacs:

fatal: unable to access 'https://github.com/dimitri/el-get.git/': Failed to connect to github.com port 443 after 133553 ms: Connection timed out

No software configuration changes were made during the WSL1-WSL2 upgrade.

It reminds me of a similar problem I encountered on Google Cloud - this one time a Linux VM were running into TCP connection timeouts seemingly at random, and as it turned out (described by a colleague) the Cloud NAT table "was full". Does this problem of WSL2 have anything to do with Windows firewall's NAT limitation?

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

No branches or pull requests

6 participants