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

Hibernate breaks WSL Hyper-V Adapter #11388

Open
1 of 2 tasks
jedthe3rd opened this issue Mar 27, 2024 · 5 comments
Open
1 of 2 tasks

Hibernate breaks WSL Hyper-V Adapter #11388

jedthe3rd opened this issue Mar 27, 2024 · 5 comments
Labels

Comments

@jedthe3rd
Copy link

Windows Version

10.0.19045.4170

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.146.1-2

Distro Version

No response

Other Software

No response

Repro Steps

From a clean wsl2 install following these steps:

Clean WSL2 install Uninstall wsl and related stuff 1. In powershell (as admin) #list all installed distroswsl -l -v #destroy distroswsl --unregister Ubuntu wsl --unregister Debian #and so on
2. In Settings > Apps > Apps & Features
• search for Ubuntu (then Debian, etc), and if something is found, click on uninstall
• search for Linux, and if something is found, click on uninstall on all results

3. In Start Menu > Turn Windows Features on or off
• Untick Virtual Machine Platform checkbox
• Untick Windows Subsystem for Linux checkbox

4. Reboot
• I might have reboot between step 2) and 3) as well.

Re-install and configure wsl to use systemD
1. Installing wsl - In powershell (as admin)
#install wsl
wsl --install
Open Turn Windows Features on or off
Tick Hyper-V, Containers, Windows Hypervisor Platform
Then reboot and wait for the Ubuntu installation to complete and ask for username (it might takes some time).

Assumptions:
System is behind a corporate proxy and a vpn.

Run WSL2 configure it with your ca-cert, proxy env variables, disable generateResolvConf in wsl.conf, unlink /etc/resolv.conf and create a new resolv.conf with proper dns server for your network.
Run curl https://example.com and you should get back a proper response.

Hibernate your machine (sleep also works) and then wake it up, try to run the curl command again and notice that https://example.com will fail to resolve. (this also happens if you close your wsl2 session and hibernate then reenter your session).

Resolve the issue by restarting your machine (resetting WSL2 via shutdown and restarting the services does not resolve the issue).

Expected Behavior

Upon waking computer WSL2 networking works as it did before hibernation/sleep.

Actual Behavior

WSL2 networking breaks after waking from hibernation/sleep. WSL Hyper-V network adapter breaks.

Diagnostic Logs

Event viewer has this error when trying to recreate the WSL hyper-v network adapter after hibernation:

Switch port create failed, switch = '53BC0EA5-873D-40A9-B67A-B4E825654625', port name = '919761FE-55EE-4856-9F95-2D2E84DD8D86', 
port friendly name = 'WSL': Illegal operation attempted on a registry key that has been marked for deletion. (0x800703FA).
Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How 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
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

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!

Open similar issues:

Closed similar issues:

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

@jedthe3rd
Copy link
Author

Here are the logs:
WslLogs-2024-03-27_18-40-21.zip
I started the logs before hibernating then hibernated my laptop and woke it up.

I have podman desktop installed but this issue occurs on any WSL2 distro and occurred before I installed podman desktop.

The reason I created this report even though #4992 exists is because none of the work arounds that aren't restarting my computer work to resolve the issue.

Copy link

Diagnostic information
.wslconfig found
	Custom kernel command line found: 'cgroup_no_v1=all'
appxpackage.txt not found

@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

@jedthe3rd
Copy link
Author

I am uploading via the email. I needed to exclude the trace files to be able to send it. Let me know if you need those and how I could upload them more securely.

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

3 participants