I’m : a web and mobile developer based in the Australia.

WSL2 and WSLg preventing Windows 11 from sleeping

I recently experienced an issue where a freshly installed Windows 11 system was not going to sleep. It was a very similar set up in terms of software to my previous Windows 10 machine which did not seem to have any issues.

Searching online I found which led me to the extremely useful powercfg -requests command. Using this I noticed a WSL entry for msrdc.exe. I guessed that this must have had something to do with Microsoft Remote Desktop connection - but from Linux.

Armed with this I was able to find whose title of "Displays do not go to sleep when WSLg is enabled" summed up my problem.

As I did not need WSLg support in WSL2 I followed to disabled it. A reboot later and all sleep issues were resolved. Hopefully the original issue is resolved before I would like to use GUI applications in WSL2.