I am on a dual boot laptop running Ubuntu 17.04 and Windows 7. Booting into windows sets RTC to local time, breaking the system clock in ubuntu.
I do not want to change the RTC configuration on ubuntu or windows; I want ubuntu to sync time to the network as soon as there is a network connection. This used to be done with ntpdate (which is now deprecated) and as far as I can see, the current configuration for ubuntu systems uses systemd-timesyncd. This is not working, and so far I have been unable to force timesyncd to sync time.
/etc/systemd/timesyncd.conf is set to use pool.ntp.org:
[Time] NTP=0.pool.ntp.org FallbackNTP=1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
However, systemd status shows that timesyncd is not capable of connecting to pool.ntp.org:
● systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled) Drop-In: /lib/systemd/system/systemd-timesyncd.service.d └─disable-with-time-daemon.conf Active: active (running) since Mon 2017-08-07 10:13:38 PDT; 1min 44s ago Docs: man:systemd-timesyncd.service(8) Main PID: 986 (systemd-timesyn) Status: "Idle." Tasks: 2 (limit: 4915) CGroup: /system.slice/systemd-timesyncd.service └─986 /lib/systemd/systemd-timesyncd Aug 07 10:13:37 rachael systemd: Starting Network Time Synchronization... Aug 07 10:13:38 rachael systemd: Started Network Time Synchronization. Aug 07 10:14:48 rachael systemd-timesyncd: Timed out waiting for reply from 188.8.131.52:123 (0.pool.ntp.org). Aug 07 10:14:59 rachael systemd-timesyncd: Timed out waiting for reply from 184.108.40.206:123 (0.pool.ntp.org). Aug 07 10:15:09 rachael systemd-timesyncd: Timed out waiting for reply from 220.127.116.11:123 (0.pool.ntp.org). Aug 07 10:15:19 rachael systemd-timesyncd: Timed out waiting for reply from 18.104.22.168:123 (0.pool.ntp.org).
This is probably due to the fact that timesyncd depends on networkd, but since ubuntu uses network-manager to handle its connections, networkd is disabled:
● systemd-networkd.service - Network Service Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:systemd-networkd.service(8)
Incidentally, timedated is also disabled (no idea if this is relevant):
● systemd-timedated.service - Time & Date Service Loaded: loaded (/lib/systemd/system/systemd-timedated.service; static; vendor preset: enabled) Active: inactive (dead) Docs: man:systemd-timedated.service(8) man:localtime(5) http://www.freedesktop.org/wiki/Software/systemd/timedated
Consequently, timedatectl lists ntp sync as disabled, independent of the content of the config file:
Local time: Mon 2017-08-07 10:27:48 PDT Universal time: Mon 2017-08-07 17:27:48 UTC RTC time: Mon 2017-08-07 17:27:48 Time zone: America/Los_Angeles (PDT, -0700) Network time on: yes NTP synchronized: no RTC in local TZ: no
Trying to enable ntp sync on timesyncd by hand has no effect. i.e.:
# timedatectl set-ntp true
How is network time synchronization supposed to work in newer ubuntu systems?