如何同步Windows客户端和Linux NTP服务器之间的时间?

我希望我的Windows 7机器从我的Linux Debian Sid服务器上获得时间。

所以我想提前从Debian仓库安装OpenNTPD 。 它不会默认听任何东西,所以我configuration如下:

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是我局域网上服务器的IP地址。 我在Windows设置中input它,我得到这个:

在这里输入图像说明

我使用networking嗅探器(Wireshark)来检查这是否是networking问题。 这不是:Windows高兴地发送NTP数据包,并从我的服务器接收响应。 我猜Windows对服务器的回答并不满意。 事情是,我不知道为什么…

这是Windows机器上w32tm /query /verbose /peers的结果:

 #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 

“未指定的错误”对我没有多大帮助。 任何想法发生了什么?

时间服务器需要几个样本来确保正确读取上游服务器并正确设置自己的层。 有时需要一段时间。 通常less于10分钟。

当你得到这样的错误时,你应该首先检查你的NTP服务器正在报告的层次。 从NTP服务器设置时间的窗口是有限的,但我不记得我的头顶。

那么,大卫·施瓦茨是正确的:当我花时间写我的问题,我的NTP服务器得到同步,Windows成功地更新了它的时钟。

坦率地说,我不知道我需要等待 。 我以为是瞬间的 当OpenNTPD写入clock is now synced时候,你clock is now synced到系统日志,而不是之前。 那么,很高兴知道。

如果只有来自Windows的错误消息更明确一些…

当您尝试与Windows Server 2003中的非Windows NTP服务器进行同步时,时间同步可能会失败http://support.microsoft.com/kb/875424