Repository navigation
Description
- Your Windows build number (run
verat a Windows Command Prompt), your distribution (f.e. on Debian/Ubuntu runlsb_release -r), and whether the issue manifests on WSL 2 and/or WSL 1 (cat /proc/version):
Windows: version 2004, build 19041.264
Distro: Ubuntu 18.04
Issue manifests only on WSL2 (Linux version 4.19.84-microsoft-standard)
- What you're doing and what's happening. Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screenshots if that helps demonstrate the problem:
I upgraded an Ubuntu 18.04 WSL1 instance to WSL2. Ever since then, the date does not advance when the machine is asleep or hibernating. To repro:
- Install Ubuntu 18.04
- Check that Windows system date is correct
- Check that date is correct (use
datecommand in WSL2) - Put laptop to sleep for a while
- Resume from sleep
- Check Windows date: correct
- Check WSL2 date: wrong, still where it was when machine went to sleep
- Wait a while to see if it auto-corrects
- Notice that it doesn't
What's wrong / what should be happening instead:
- Date does not update after sleep. It should be correct after resume, as it was in WSL1.
Note that there was a previous issue on this topic, #4245 which is now closed, I'm not sure why; it was recommended there by therealkenc that I open a new issue.
There are temporary workarounds; if I use sudo hwclock -s or shut down the WSL2 VM with wsl --shutdown and restart, the time is correct, until the next sleep/hibernate.
As noted in various other issues on this topic (#5184, #4975, #4677 etc.), the time being incorrect is more than a minor inconvenience. It can cause trouble with apt install, validity of SSL certs, build problems, and many other issues.
Activity
benhillis commentedon Jun 3, 2020
Gary Oberbrunner (@garyo) - Thanks for opening a new issue. We made a previous change to send clock sync packets when the system resumes from sleep, but it looks like we are not receiving those notifications in some cases. I have an ongoing conversation with the Windows Power team, it looks like they are not correctly delivering the notifications upon system resume in some cases.
dwaynebradley commentedon Jun 11, 2020
Gary Oberbrunner (@garyo) Ben Hillis (@benhillis) I just tried this again on my laptop (original Surface Book) and the date/time seems to be keeping up-to-date after wake up from sleep in my setup now.
Windows: version 2004, build 19041.329
Distro: Ubuntu 20.04
Linux kernel version: 4.19.104-microsoft-standard
I put my laptop to sleep for about a minute or so, woke it back up and checked the date/time again in WSL and it seems to be updated now. Probably need to try on a longer sleep timeframe just to double-check though. I'll try this again later and report back when I have a longer period to put it to sleep.
dwaynebradley commentedon Jun 12, 2020
Follow up on my previous comment...
I put my laptop to sleep last night. When I opened it up this morning, the first thing I did was to check the time in WSL (Ubuntu 20.04). Low and behold...it was correct!!! :-)
For my setup at least, this appears to be fixed now.
garyo commentedon Jun 12, 2020
Dwayne Bradley (@dwaynebradley) are you saying it's fixed by something Microsoft did, or did you install one of the workarounds such as #4245 (comment)?
dwaynebradley commentedon Jun 12, 2020
Gary Oberbrunner (@garyo) fixed by Microsoft apparently. No workarounds on my end.
dwaynebradley commentedon Jun 15, 2020
Well, I just tried it again today after leaving my laptop in sleep overnight and the date is way off again. Apparently it isn't fixed after all...
MauriceS-gti commentedon Jun 19, 2020
Second this. Not fixed. Windows 10/2004 build 19041.329
Balothar12 commentedon Jun 20, 2020
I'm assuming this is the same problem, but neither wsl --shutdown nor hwclock fixes it for me, so I'm not completely sure. Whenever I try to build anything (configured with cmake, built with make), I get the clock skew warning, albeit with very small times (usually below 2 seconds and quite often below 1). Interestingly it does not appear that any builds have actually failed due to this yet, things seem to be complete even after the warning appeared. I also haven't had any issues with apt yet that relate to this.
Windows: Version 2004, build 19041.329
Distro: Ubuntu 20.04
Linux Kernel: 4.19.104-microsoft-standard
onomatopellan commentedon Jun 20, 2020
Manuel Pahlitzsch (@Balothar12) Are your projects on /mnt/* folders? See #4975
Balothar12 commentedon Jun 20, 2020
Jonathan (@onomatopellan) Indeed they are. Didn't realize that at first since I symlinked the respective directory from my home directory and kinda forgot abut that, but yeah, the files are technically in the mounted folders. And as mentioned in #4975 the issue does not occur when the same files are actually on the Linux filesystem.
garyo commentedon Jun 20, 2020
MysticRyuujin commentedon Jul 18, 2020
I'm not sure if I have the same issue but I have the same problem...
My workstation NEVER sleeps, but still, somehow my WSL2 Ubuntu host became 20 seconds behind...
sudo hwclock -sdidn't do anything, butwsl --shutdowndid cause the clocks to re-sync.Update: Checked the time again, and it's drifted once again. It's now 2 seconds behind. No reboots or sleep since the screenshot above
eajfpeters commentedon Jul 23, 2020
Manuel Pahlitzsch (@Balothar12) and Jonathan (@onomatopellan) I found the same issue with files on /mnt/* and using make. sudo hwclock -s does not help. After executing this command I still get warnings like
make[2]: Warning: File 'CMakeFiles/yaml-cpp.dir/depend.make' has modification time 0.6 s in the future
and
make[2]: warning: Clock skew detected. Your build may be incomplete.
The warnings are not in vain. Later I found that in fact the library I had build was incomplete and I got issues using it when trying to link it to my own code. When I moved all to the Linux side and rebuild the library it was complete. I also find that i/o of files located in /mnt/* is very slow. Probably this clock warning due to sub-second lags and slow /mnt/* file handling are related.
wsy commentedon Jul 28, 2020
Hi Ben Hillis (@benhillis) , I'd like to remind you of another scenario about clock sync packet and Windows Power state.
That is NESTED VIRTUALIZATION.
I got a physical computer running Hyper-V. I created a virtual machine with nested virtualization enabled and I installed Windows 10 2004 on that virtual machine. Inside Windows 10, I enabled Hyper-V and enabled WSL2.
Now my Ubuntu 20.04 is 50 minutes behind my Windows 10 clock. This is possibly because the virtual machine got paused when I restarted my host machine.
I guess in this scenario, Windows 10 would never have received any event notification because there's nothing a guest OS needed to do. Thus Windows 10 would never have notified WSL2 kernel of something that's "never happened".
238 remaining items
esumii commentedon Mar 20, 2023
Unfortunately, it does not work unless the .bashrc or the hourly cron runs.
hywan9 commentedon Mar 23, 2023
Same error.


duaneking commentedon Mar 23, 2023
It really worries me that Microsoft has apparently decided that this critical security issue is a low priority, given the amount of money that Microsoft customers have spent and invested on WSL based solutions to integrate windows with their Linux platforms.
Would anybody from a cybersecurity company be willing to help create a CVE about this issue? Because it does create security issues when TLS wont connect due to time differences, and Time is as a critical security component... so if it's not working then you can't trust the regulatory and security compliance of the systems involved.
This is creating auditing nightmares in the real world; I can't go into detail but I can say that it's costing companies a lot of money and it's creating a lot of risk for a lot of people. Fix this asap please.
dimo414 commentedon Mar 23, 2023
You might want to weigh in on #8204 which is still open. Unfortunately there's more than a dozen related bugs, seemingly because this issue has been fixed and regressed multiple times, which makes tracking down the current status very hard.
levrik commentedon Apr 24, 2023
A new megathread to track this issue has been opened. MS employees have linked it from all other open issues but not from this already closed one. So I thought I'll add this here in case someone stumbles upon this issue.
#10006
kumkee commentedon Jul 18, 2023
The following comment by J.B. Langston (@jblang) is easily the best one.
By the way, can we achieve
# ConditionVirtualization=!containerby editing the less invasive/etc/systemd/timesyncd.conf?Originally posted by J.B. Langston (@jblang) in #5324 (comment)
gnantel commentedon Jul 18, 2023
sudo systemctl edit systemd-timesyncdwith the following contents:References: https://unix.stackexchange.com/a/737366/272577 and #8204 (comment)
kumkee commentedon Jul 18, 2023
Thank you. That's exactly what I am after.
webstean commentedon Sep 15, 2023
Still an issue, it's a bug!!!!!
lindhe commentedon Oct 5, 2023
Andrew Webster (@webstean) Please see #10006
silvio2402 commentedon Oct 16, 2023
I tried the listed methods to fix the time not being synced, but none of them worked.
After doing
sudo ntpdate time.windows.com(you have to install ntpdate first) and thensudo service hwclock.sh reloadthe clock was synced successfully.kumkee commentedon Oct 18, 2023
For those who are still struggling in October 2023, doing both of the following will solve the problem and save you from manually syncing every time.
schtaskssystemd-timesyncdBut I agree it is still a bug.
Update in March 2024: the kernel update mentioned in @masud-abdulkadir's reply 2 posts below does seem to fix the bug. Tested on WSL 2.1.4.0 with Kernel 5.15.146.1-2.
lzcmian commentedon Dec 15, 2023
same bug
killmasud commentedon Feb 11, 2024
Newer people, it's finally being fixed here in #10006 currently in pre-release so you can update to that or keep your workarounds until its in release and then update, i mean we've waited near 4 years, can wait a little longer eh? :p Here is the link to the comment, and here is the patch itself if you're curious.
mohammadriyasriyas468-png commentedon Aug 12, 2025