Time Drift in WSL2/Hyper-V

A day ago, I ran into this curious issue where Pusher was rejecting API requests due to some time error on an app that I’m developing on Linux, with the host as WSL2. I have been a WSL1 user for years now and have never encountered this problem, so it was quite surprising.

And it would appear that the problem is a well-known one. If your device goes into suspend/hibernate and the WSL2 instance is still running, time, literally, comes to a standstill for it. And once you resume your computer, the instance does not sync the time and it creates all sorts of problems.

There is no official fix for the problem so far. You can force the instance to update the time and work around it. There is a nifty fix here that you can use to do this in an automated manner.

Never mind.