I'm managing some VirtualBox developer environments. The time drifts out of sync when the box is suspended, so I want to use NTP to keep it in sync.
NTP doesn't seem to be doing its job, though - the time does not get updated.
It does work if I do this:
$ service ntp stop
$ ntpdate au.pool.ntp.org
$ service ntp stop
Here is my /etc/ntp.conf
:
driftfile /var/lib/ntp/ntp.drift
# Set tinker panic - see http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427
# Makes time sync more aggressively in a VM.
tinker panic 0
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Specify one or more NTP servers.
server au.pool.ntp.org
# Specify one or more NTP servers.
server 0.pool.ntp.org
Here's the relevant lines from /var/log/syslog
:
Jun 20 18:51:30 vg ntpd[7239]: ntpd 4.2.6p3@1.2290-o Tue Jun 5 20:12:08 UTC 2012 (1)
Jun 20 18:51:30 vg ntpd[7240]: proto: precision = 0.191 usec
Jun 20 18:51:30 vg ntpd[7240]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Jun 20 18:51:30 vg ntpd[7240]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen and drop on 1 v6wildcard :: UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen normally on 2 lo 127.0.0.1 UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen normally on 3 eth0 10.0.2.15 UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen normally on 4 eth1 192.168.33.10 UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen normally on 5 eth2 192.168.0.156 UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen normally on 6 eth0 fe80::a00:27ff:fea0:5444 UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen normally on 7 eth2 fe80::a00:27ff:fe1c:18ae UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen normally on 8 eth1 fe80::a00:27ff:fe02:b8f6 UDP 123
Jun 20 18:51:30 vg ntpd[7240]: Listen normally on 9 lo ::1 UDP 123
Jun 20 18:51:30 vg ntpd[7240]: peers refreshed
Jun 20 18:51:30 vg ntpd[7240]: Listening on routing socket on fd #26 for interface updates
In the above logs, the date is a full 14 hours behind.
The three interfaces are a quirk of our dev environment. eth2 is the interface with an IP on the office NAT, providing internet access.
I have NTP 4.2.6, running on Ubuntu 12.04 (Precise).
Why is NTP not updating the time on this machine?
ntpdate -b
? – Hauke Laging Jun 21 '13 at 03:00/etc/ntp/step-tickers
and then restart the ntp service. I had a simlar issue with vmware host and it works for me. – Raza Jun 21 '13 at 03:40ntpdate pool.ntp.org
first without the ntpd daemon running? Next, are you confident the ntpd daemon is running (try runningntpq -p
for a list of upstream NTP servers and measured delay/jitter/status). Finally double check your virtual host manager isn't also fighting to set the clock also (VMWare is notorious for this). – PP. Jun 21 '13 at 11:20