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

No internet connection under WSL2, but works fine under WSL1 #10349

Open
2 tasks done
0xBeshoy opened this issue Jul 29, 2023 · 17 comments
Open
2 tasks done

No internet connection under WSL2, but works fine under WSL1 #10349

0xBeshoy opened this issue Jul 29, 2023 · 17 comments

Comments

@0xBeshoy
Copy link

0xBeshoy commented Jul 29, 2023

Windows Version

Microsoft Windows [Version 10.0.19045.3208]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu

Other Software

No response

Repro Steps

Installed multiple versions of Ubuntu (18, 20, 22) from different sources (Windows store, wsl cli, downloaded directly from windows wsl docs page)

Expected Behavior

Working internet connection under both versions of the distro installations, but it only works while using WSL1 but no way to make it work again under WSL2

Actual Behavior

I was only using WSL2 for all my Linux usage, and suddenly out of nowhere, WSL2 stopped connecting to the internet. I used every possible solution out there to make it work again:

  • Tried changing the nameserver in /etc/resolvr.config setting: it didn't work
  • Tried locking the automatic generation of the wsl.config file: it didn't work
  • Removed the entire distro and reinstalled it again: it didn't work
  • Removed the entire distro, uninstalled WSL, disabled (WSL, Hyper-V, Virtual Machine Platform) from Windows Features, and re-enabled everything again, and then installed a fresh distro from the Microsoft Store: it didn't work
  • Done the exact same steps as above, but installed the distro from WSL CLI: it didn't work

I've defaulted for the moment to WSL1, until I can fix this. Otherwise I guess I'll do a fresh Windows installation.

Diagnostic Logs

I ran the collect-wsl-logs.ps1 script and when asked to reproduce the issue I ran ping bing.com on the WSL machine that doesn't connect to the internet. I uploaded the log files as is without touching them.
https://github.com/0xBeshoy/wsl/blob/main/WslLogs-2023-08-09_15-58-30.zip

@theunwisewolf
Copy link

I am also having the same issue.
Interesting thing is that Docker Desktop (whatever custom distro it uses) works fine with wsl2. But the Ubuntu distro has no internet on wsl2 (wsl1 is fine)

@ghost
Copy link

ghost commented Aug 1, 2023

Do you know if this occurred as a result of a specific windows update?

/logs

@microsoft-github-policy-service
Copy link
Contributor

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!

@0xBeshoy
Copy link
Author

0xBeshoy commented Aug 2, 2023

@pmartincic which files from the logs generated should I upload to the issue, it generated a lot of files, and I'm concerned about personal info being leaked. Thanks for your help and time :)
Edit:
Regarding the Windows update, I don't think so, actually, I got an update after this happened and thought this update might fix the problem, but it didn't.

@ghost
Copy link

ghost commented Aug 8, 2023

Well, we would like all the logs? It'll contain arguments passed to wsl.exe, for example. More specifically the etl? If you desire, you may parse most of that file using WPA or tracefmt. If you choose not to share, that is your choice? But that also means we can't do much.

You can also email it to our PM: [email protected] if you prefer that route.

@ghost ghost added the needs-author-feedback label Aug 8, 2023
@0xBeshoy
Copy link
Author

0xBeshoy commented Aug 9, 2023

@pmartincic I've updated the issue with the logs needed, thanks for your time and patience ✌

@thes01
Copy link

thes01 commented Aug 11, 2023

Hello, similar thing happened to me recently. Internet connection in WSL2 stopped working when the laptop is connected to my mobile hotspot. When connected to a router, everything works ok. WSL1 works for both mobile hotspot and router.

@0xBeshoy
Copy link
Author

Hello, similar thing happened to me recently. Internet connection in WSL2 stopped working when the laptop is connected to my mobile hotspot. When connected to a router, everything works ok. WSL1 works for both mobile hotspot and router.

@thes01 did you find a way to fix it?

@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

@0xBeshoy
Copy link
Author

Why close the issue? I'm still waiting for @pmartincic reply

@ghost
Copy link

ghost commented Aug 28, 2023

That's an error on our part, reopening

@ghost ghost reopened this Aug 28, 2023
@ghost ghost mentioned this issue Aug 29, 2023
2 tasks
@0xBeshoy
Copy link
Author

That's an error on our part, reopening

Thank you, appreciate your patience and time ✌️

@str0mback
Copy link

Disable "Windows Hypervisor Platform" - solved it for me.
This is what features I have enabled:

image

@0xBeshoy
Copy link
Author

0xBeshoy commented Sep 4, 2023

Disable "Windows Hypervisor Platform" - solved it for me.
This is what features I have enabled:

image

Tried this solution today, didn't work for me. Thanks anyway ✌️

@str0mback
Copy link

Disable "Windows Hypervisor Platform" - solved it for me.
This is what features I have enabled:
image

Tried this solution today, didn't work for me. Thanks anyway ✌️

How did you install WSL?
Also, make sure you've got these disabled (I'm only using Hyper-V for Guarded Host, not for any actual VM's):
image

@spufidoo
Copy link

spufidoo commented Feb 1, 2024

I've been suffering with this as well. I've read the issue with interest, tried out a few things, but to no avail.
I'd really like this to be solved.
Is there anything I could try?

@CutupAngel
Copy link

CutupAngel commented Aug 27, 2024

Here is the solution.
#4150 (comment)

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