How to synchronize time between a Windows client and a Linux NTP server?
Solution 1
Time servers take a couple of samples to make sure they are reading the upstream servers properly and to set their own stratum correctly. It sometimes takes a while. Usually less then 10 minutes.
When you get an error like that you should first check the stratum your NTP server is reporting. There is a limit on how low windows will go to set its time from a NTP server, but I dont recall off the top of my head.
Solution 2
Well, David Schwartz was right: by the time it took me to write my question, my NTP server got synchronized and Windows successfully updated its clock.
Quite frankly, I had no idea I needed to actually wait for it. I thought it was instantaneous. You're good to go when OpenNTPD writes clock is now synced
to the syslog, not before. Well, good to know.
If only the error messages from Windows were a little more explicit…
Etienne Dechamps
Updated on September 18, 2022Comments
-
Etienne Dechamps over 1 year
I want my Windows 7 machine to get its time from my Linux Debian Sid server.
So I want ahead and installed OpenNTPD from the Debian repository. It doesn't listen to anything by default, so I configured it as follows:
listen on 192.168.0.1 server 0.debian.pool.ntp.org server 1.debian.pool.ntp.org server 2.debian.pool.ntp.org server 3.debian.pool.ntp.org
192.168.0.1
being my server's IP address on my LAN. I entered it in the Windows settings and I got this:I used a network sniffer (Wireshark) to check if this was a network issue. It's not: Windows is happily sending NTP packets and receives responses from my server. I guess Windows is not pleased by the answer it gets from the server. Thing is, I have no idea why…
Here's the result of
w32tm /query /verbose /peers
on the Windows machine:#Peers: 1 Peer: 192.168.0.1,0x9 State: Active Time Remaining: 604046.2718893s Mode: 3 (Client) Stratum: 0 (unspecified) PeerPoll Interval: 0 (unspecified) HostPoll Interval: 10 (1024s) Last Successful Sync Time: (null) LastSyncError: 0x80004005 (Unspecified error ) LastSyncErrorMsgId: 0x00000000 (Succeeded) AuthTypeMsgId: 0x0000005A (NoAuth ) Resolve Attempts: 0 ValidDataCounter: 2 Reachability: 4
"Unspecified error" doesn't help me much. Any idea what's going on here?
-
mdpc over 12 yearsIs this a firewall problem on the debian box?
-
Etienne Dechamps over 12 yearsDavidSchwartz: thank you (see answer) mdpc: I ruled out network issues in my question (sniffer showing packets flowing in both directions).
-
Etienne Dechamps over 12 yearsOh, and OpenNTPD does not provide
ntpq
. -
cco over 12 yearsTry ntpdc -p that will show what you server is associtaed with and what stratum they are.
-
-
David Schwartz over 12 yearsIt is impossible to synchronize two time sources instantaneously. You can make them show the same value at the time you synchronize them, but that does not make them synchronized. ('Synchronized' means operating in unison.)