Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

NTP on a Debian 10 VM (Time goes out of sync)

In one of my newer Debian VM (Debian GNU/Linux 10 (buster)), I see that the time sync service has some issues. The machine clock falls behind the standard time by a couple of minutes every now & then. The local timezone of the machine is set to IST.

I need to restart the service with the following command (sudo service chrony restart) to get the time synced again.

Any solution for this?

Thr gcloud docs link for this is given below:

https://cloud.google.com/compute/docs/instances/configure-ntp

Logs: I do not see any errors in the logs, but after restarting the log looks like this:

Starting chrony, an NTP client/server...
chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 -DEBUG)
Frequency -93.458 +/- 0.001 ppm read from /var/lib/chrony/chrony.drift
Loaded seccomp filter
Started chrony, an NTP client/server.
Selected source 169.254.169.254
System clock wrong by 98.886791 seconds, adjustment started
System clock was stepped by 98.886791 seconds

I am using the default config file (/etc/chrony/chrony.conf):

server metadata.google.internal prefer iburst
keyfile /etc/chrony/chrony.keys
logdir /var/log/chrony
maxupdateskew 100.0
rtcsync
makestep 1 3
Solved Solved
1 4 1,865
1 ACCEPTED SOLUTION

Upgrading to Debian 11 solved this problem.

View solution in original post

4 REPLIES 4

Hi OjalMhatre,

I took a look at the Chrony Documentation and FAQ, and everything shared in your documentation looks correct, so it should be making the adjustment right away upon start.

I'd recommend first disabling and re-enabling Chrony to start before possibly looking into adding a driftfile line as it would allow the chronyd program to work out the rate at which the system clock gains or loses time relative to real time.

They also suggest in the FAQ that for VMs you could set the makestep values to 1 -1.

Hope this helps!

Thank you, appreciate your help.

It's been one week since I applied the suggested changes. The issue has not been observed since then.

The issue is still happening... So I am not sure what the cause is. Anyways, we shall upgrade to Debian 11 soon & hopefully it is not a problem there.

Upgrading to Debian 11 solved this problem.