Fix WSL time drift

There is a bug in WSL2 that causes the clock inside the VM to drift behind the actual clock on the machine.

This can lead to many unexpected issues, ranging from harmless (git commit messages having old timestamps) to severe (SSL connection failures).

We can sync the VM clock using the command

1
sudo hwclock -s

We can also add the command as a cron job every 5-10 minutes to make sure that the clock doesn’t drift too far back.

All content is licensed under CC BY-NC-SA 4.0. Copying is an act of love - please copy!
More cool websites: Prev | Hotline Webring | Next
Built with Hugo
Theme Stack designed by Jimmy