Megathread
Current status: waiting on backport for kernel patch to mitigate issue.
We're creating this megathread to track the clock skew issues in WSL in one place, and will keep this parent comment current with any updates.
Background
Sometimes the WSL clock can become skewed after resume from sleep (specifically S0). See some example related issues for more info:
#8318
#8204
#7255
Potential work arounds
Use systemd to force clock sync
See this comment: #8204 (comment)
Set the hardware clock via a command
Run sudo hwclock -s. More info here.
Run ntpdate on distro start up
Edit /etc/wsl.conf to have this content:
[boot]
command="ntpdate ntp.ubuntu.com"
This will force a clock reset on start up of the distro.
Build a private kernel with this patch
Megathread
Current status: waiting on backport for kernel patch to mitigate issue.
We're creating this megathread to track the clock skew issues in WSL in one place, and will keep this parent comment current with any updates.
Background
Sometimes the WSL clock can become skewed after resume from sleep (specifically S0). See some example related issues for more info:
#8318
#8204
#7255
Potential work arounds
Use systemd to force clock sync
See this comment: #8204 (comment)
Set the hardware clock via a command
Run
sudo hwclock -s. More info here.Run
ntpdateon distro start upEdit /etc/wsl.conf to have this content:
This will force a clock reset on start up of the distro.
Build a private kernel with this patch