Linux – How to synchronize time between a Windows client and a Linux NTP server

linuxntpntpdwindows

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:

enter image description here

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?

Best Answer

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.