WSL2 - Suspend Resume RTC bug

5 min read
February 14, 2022
July 8, 2025
Last updated:
July 11, 2025
Neil Cresswell
Neil Cresswell
,
Portainer CEO
Follow on LinkedIn
Table of Contents

Share this post
This is some text inside of a div block.

Key takeaways

Another little annoying bug that hit us, and we just found a fix for..

A little known bug with WSL2 is that it does not correctly handle resuming from a suspended state.  When it does resume, the RTC clock simply continues from where it left off.. which is a problem if your machine is suspended for a few days..

No biggie, right... wrong... with so much of the internet (and Kubernetes) forcing the use of TLS/SSL, all communications are checking x509 Certificate validity dates. For that check to work reliably, it requires that devices are kept in sync with actual date / time..

a common error seen would be:

error: Post \"https://x.x.x.x:6443/api/v1/namespaces\": x509: certificate has expired or is not yet valid: current time 2022-02-12T13:17:04Z is before 2022-02-14T08:53:54Z]

So, what to do...

Well, its actually already fixed by MS, but for some reason, its not updated as part of Windows Update (no idea why).. to fix it, simply open a PowerShell windows as admin, and then type wsl --update

Then either restart WSL as it says, or reboot your PC...

No more RTC issues after this.. lovely.

Neil

Infrastructure Moves Fast. Stay Ahead.

Subscribe to our monthly newsletter

Conclusion

Neil Cresswell
Portainer CEO
Follow on LinkedIn

Neil Cresswell is the co-founder and CEO of Portainer, a popular platform that simplifies container management for Docker, Kubernetes, and edge environments. A veteran of over 25 years in IT, he began his career with 12 years at IBM before leading VMware consulting at ViFX across Asia-Pacific and serving as CEO for cloud service providers. Frustrated by the lack of usable tooling for “containers as a service,” he created Portainer to make container technology accessible to everyone. Under his leadership, Portainer has grown from an open-source UI into an enterprise-ready platform used globally.

Tip  / Call out