-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL2: Clock skewed? #4677
Comments
|
You should also be able to use |
@therealkenc - Specifically large skews when resuming from sleep should be fixed, but small skews that accumulate during runtime may still be an issue. |
This is still a problem in The machine have been running WSL2 for some days, the clock in WSL2 is:
And in windows
This is running the debian distro which supposedly has a hwclock.sh service running, but doesn't seem to sync. Running |
Just updated to Windows 10 build 19041.21 to start to use WSL-2 make[2]: Warning: File 'samples/convert.cpp/CMakeFiles/convert-cpp.dir/depend.make' has modification time 0.022 s in the future WSL-1 has never reported these warnings on the same configuration. |
Windows 10 build 19041.153 attempting to use WSL2, files are on Windows file system (not rootfs):
|
That seems to be an Hyper-V issue instead of an WSL one. I have had issues with time on Hyper-V instances ever since. Any time I wake up my machine from sleep I have to manually run |
While checking
|
adding that I see this issue as well. I don't see a clear pattern between shutdown vs hibernate, but occasionally clock sensitive operations will fail until I re-sync (AWS or Azure CLI for example). |
I still see this issue using Windows 10/2004 build 19041.329. HOURS of difference: PS C:\src\cs> date |
To add this is causing problems when running AWS cli commands when my Windows machine running WSL2 has slept. For example: aws ecr get-login-password Results in an error like (InvalidSignatureException) when calling the GetAuthorizationToken operation: Signature expired: <DATE> is now earlier than <DATE> (<DATE> - 15 min.) |
@benhillis Running
EDIT: WSL2 uptime is 5 days without sleep. |
Microsoft Windows [Version 10.0.18363.1198] When I try to build with cmake I get the following warning: I tried building both in the shared filesystem, i.e. /mnt/c and in my home folder in the wsl2 installation. Same issue. Running |
Running 19041.746 with Ubuntu 20.04.1 LTS and GNU Make 4.2.1 Tried all the mentioned possible fixes included in this thread including rebooting, wsl --shutdown, and the shell commands listed. The clock in W10 and Ubuntu are definitely at least to the second matched up. Still get this error when running make. Haven't observed it with other utilities yet. UPDATE: I was able to discern that the clock skew is about 0.43 to 0.45 seconds. I can sync windows time and try to 'make' right after, and the issue is still present. |
I wrote a program to workaround this problem: https://github.com/nbdd0121/wsld. Assuming you don't also need X11 forwarding, you can put [time] in It will sync time from Windows every 10 minutes, and will adjust time like NTP. |
This is dup of #5324 |
/dupe #5324 |
Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
I don't think this is a dupe; I've seen my clock drifting without sleep or hibernation. |
From the latest comment (at time of writing), there is a kernel patch which
should fix this. It is being tested but is not released yet. (Per the
comment in that issue)
|
Since this issue pops first from google, Issue comment 5650 here's how one can install the update 😁, this has fixed the issue for me 😄 |
I ran into this today, |
I keep receiving the message even after trying the hwclock and touch workarounds. The problem seems to be that the files generated during compiling have a timestamp 2-4 second in the future. This seems as a major bug to me. Keep in mind that most companies block the Microsoft Store and implement proxies that block NTP. |
This is found on WSL2.
Please fill out the below information:
ver
at a Windows Command Prompt)Version 1903 Build 19018.1
What you're doing and what's happening: Clock way off.
What's wrong / what should be happening instead: Clock should be in sync with the host.
Windows taskbar clock says
5:22pm
WSL Linux (Ubuntu)
date
: says 05:09:23 PSTThe clock appears to be about 12 hours 13 minutes off? I don't see any obvious ways to resolve this as ntpdate is not installed by default, there's no systemd-style init process that would run ntpd/etc.
The net impact is that time-sensitive things like credential or request signing will all appear expired by the receiver because my requests are signed "12 hours ago" ;)
Thoughts?
The text was updated successfully, but these errors were encountered: