time sync with ntpd

I run Debian on several systems, and their times do not seem to stay in sync. I can run ntpdate manually, but I thought that I should have an ntpd running that would automate that.

I did check with apt and apt-cache but don't find any ntpd (or associated ntpq), not any such names in my system (locate...), but ntp-doc does still describe them.

Looking around I see that there is an ntpdate-debian command, and it uses /etc/default/ntpdate for servers (instead of the standard /etc/ntp.conf), but even thought that file is there and has "yes" indicated to use ntp.conf, it fails with "no servers can be used", although ntpdate works fine. Is this just a layer over ntpdate, any reason to use it instead?

So, why are they missing, do I need them, how do I automate time updates?

Associated, two of my machines are virtualized on a MSoft VM, how is it that their clocks drift, and both to different values? (The underlying Windows machine clock seems stable). I see a few old notes about time & ntp problems on VMware, didn't find anything either current or relating to MSoft VMs. Anything I did see says just to use ntpd, but as above, ...?!


Solution 1:

The package you are looking for is ntp, which provides daemon and utilities for time synchronization.

Solution 2:

Seems to have been some install problem, I reinstalled ntp and it seems to now be corrected and ok. I don't know how it went wrong before, since ntpdate was there, but not the others.

Solution 3:

If you have a stock ntp.conf from the you may want to look adding the tinker panic 0 option to your ntp.conf. This will permit it to ignore clock jumps that wouldn't normally happen on physical hardware.

If your hypervisor is trying to do time-sync then you should get rid of ntp. Only one service should be trying to manage time within the VM. If you have an agent for your hypervisor installed, and NTP running at the same time, then badness will result.

Since you have the ntp daemon installed, make sure it is started, and then verify that it is actually running by using the ntpq -p command. This command will report which peer was selected, and some stats about NTP.

#ntpq -p -n
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+192.168.78.130   172.16.16.34    2 u   81  128  377    0.189    2.935   0.164
*172.23.206.10   172.16.16.34    2 u   72  128  377    3.648    2.902   0.109
+216.129.110.22  69.36.224.15     2 u   10  128  377   92.224  -23.697   0.704