WSL drama with hibernation

WSL is a first-party feature that allows you to run a Linux environment within Windows. It’s one of the key factors in solving for my ideal personal computing device:

  • Ultra-light, compact, with a decent keyboard: Thinkpad X1 Nano
  • Supports games I want to play: Windows
  • Functional power management: I couldn’t get it to work with Linux
  • Linux/Unix-like environment: WSL

So it was really disappointing when Vmmem (the main process for WSL) would occasionally peg the CPU at 100% out-of-the-blue, causing the fan to spin up loudly and slowing everything else down to a crawl. Running wsl --shutdown worked sometimes, but other times I had to resort to rebooting the computer.

Reading through this thread on Github, I learned that I wasn’t alone – WSL has a propensity to kick up an insatiable fuss when made to live through a hibernation. A fellow netizen offered the workaround of disabling the hibernate feature altogether, but this did not satisfy me, having grown accustomed to the Mac’s excellent power management.

Instead, I took a behavioural approach to working around this – shutting down WSL before putting the computer to sleep/hibernate, and putting up with fresh shell sessions when I come back.

It seemed okay at first, and felt like I’d adapted, but it took getting to a somewhat permanent solution for me to realise how much of a toll this adaptation really took. All the mental overhead of babysitting WSL through sleeps/hibernates, not being able to simply “pick up where I left off”, and keeping on top of saving my work because I never know when a reboot might be needed to temper its tantrum.

With the fix, it is now a non-issue. Seamless, almost magical, with zero consideration or effort directed to WSL – as it should have been from the very start.