The exact same ntp issue also happens with the Ubuntu 20.04 image being used by Atlantic.net.
After initial VM spin-up, the output of timedatectl
was showing as:
Local time: Tue 2021-01-05 00:04:37 UTC
Universal time: Tue 2021-01-05 00:04:37 UTC
RTC time: Tue 2021-01-05 00:04:37
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
NTP service: n/a
RTC in local TZ: no
Due to the NTP service showing as n/a, even though it is verified as running and enabled, your setup script passing the timedatectl set-ntp 1
would fail with:
Failed to set ntp: NTP not supported
After wasting too much time on NTP issues by verifying configs and the working of the NTP daemon, I pulled the default NTP package and installed Chrony. Problems vanished.
For whatever reason, the default ntp package used in the image:
Package: ntp
Version: 1:4.2.8p12+dfsg-3ubuntu4
is not being recognized by timedatectl
. I'm sure it is a simple fix, but it is just so much faster to replace ntp.
Hope this helps someone.