WSL: WSL shutdown crashes host PC

Version

Microsoft Windows [Version 10.0.22621.819]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.68.1-microsoft-standard-WSL2

Distro Version

Ubuntu 22.04

Other Software

systemd apache2 x11-apps

Repro Steps

It’s not exactly reproducible, but I am having this even with pretty clean WSL distro instance.

I have documneted all steps here: https://github.com/luxzg/WSL2-fixes/blob/master/networkingMode%3Dbridged-ultra-quick.md

I am using the “unsupported” (or hidden) option: networkingMode=bridged I use it together with systemd enabled,

If I start the procedure from start I sometimes crash even before installing apache2 and x11-apps, so I don’t think it has anything to do with apps installed at later stage of setup, but I’m listing them anyway.

Along the way during setup I have to shutdown WSL using: wsl.exe --shutdown

So I do exit from WSL session, and then wsl.exe --shutdown but PC crashes. Sometimes it’s blue screen, sometimes it freezes for 5-6 seconds then just reboots, but I always crash PC, then start from the start by unregistering Ubuntu distro.

I’ve managed to finish the process finally, and it maybe has something to do with me waiting those magical “8-seconds” (more like 10-11 just in case) each time between exit and shutdown. I got to that idea because of the “8 second rule” mentioned in the config docs, even though they relate to different topic.

I am still not 100% sure what causes it. I’ve been testing WSL for 2 weeks or so, trying stuff, and writing guides in process, and I do remember I had 2 such crashes, but today I’ve had it 20 times probably, 5-6 times just in last hour. Lost about 1.5 hours of writing in process (I was dumb enough to type directly to GitHub).

I’ve had it with Ubuntu 20.04 and 22.04.

I’m open to suggestions how to pinpoint what’s happening.

Expected Behavior

I run wsl --shutdown and WSL stops, without affecting rest of my PC.

Actual Behavior

Forcefull PC reboot, on 2-3 occasions with short blue screen, usually just reboots.

Diagnostic Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 23

Most upvoted comments

@aservedio I got the info it should be officially patched in 2 days.

I could say the same, but I have to say I’ve actually “eased up” a little on shutdowns, and I’m rather cautious and wait a little for distro to exit itself. I’m in no mood of causing any real damage to my only working PC at this moment 😃 Anyway, I haven’t had BSOD or forced reset since November 18th. But like I’ve said, I’ve tried to be gentle as well. I did run same procedure on ArchWSL, Debian, and today on kali-linux, trying to confirm my tutorials cover distros people ask me about. I hope BSOD is done, but I’ll keep being careful until I read about it in release notes.

Allright I’m able to reproduce my issue consistently. It almost looks like on this Windows 11 PC, if I start 2 WSL distro with systemd enabled, then I can just run wsl --shutdown once or twice and boom, compute restarts with no blue screen. That’s on the pc with the wsl --version output above.

For my other PC on Windows 10, I am unable to reproduce this issue using the exact same 2 WSL distros with systemd enabled. And it has this wsl --version output:

WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2311

Thank you for reporting this @luxzg.

Can you please follow the 10) Reporting a Windows crash (BSOD) section to report this crash ?

I will do the same. Can we add to that documentation how to undo reg.exe edit after?