Existuje ještě další způsob synchronizace systémového času Proxmox VE hosta s NTP servery a tím je služba chrony. Minule jsem popisoval alternativu systemd-timesyncd.
Nejprve zkontrolujte, zdali chrony již není insalován:
root@sr650-ext1:~# systemctl status chrony
Unit chrony.service could not be found.
Pokud dostanete výše uvedený výstup, musíte instalovat:
root@sr650-ext1:~# apt install chrony
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following packages were automatically installed and are no longer required:
proxmox-kernel-6.8.12-6-pve-signed proxmox-kernel-6.8.12-8-pve-signed
Use 'apt autoremove' to remove them.
Suggested packages:
networkd-dispatcher
The following packages will be REMOVED:
systemd-timesyncd
The following NEW packages will be installed:
chrony
0 upgraded, 1 newly installed, 1 to remove and 7 not upgraded.
Need to get 288 kB of archives.
After this operation, 503 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.cz.debian.org/debian bookworm/main amd64 chrony amd64 4.3-2+deb12u1 [288 kB]
Fetched 288 kB in 1s (252 kB/s)
(Reading database … 86397 files and directories currently installed.)
Removing systemd-timesyncd (252.39-1~deb12u1) …
Selecting previously unselected package chrony.
(Reading database … 86384 files and directories currently installed.)
Preparing to unpack …/chrony_4.3-2+deb12u1_amd64.deb …
Unpacking chrony (4.3-2+deb12u1) …
Setting up chrony (4.3-2+deb12u1) …
Processing triggers for dbus (1.14.10-1~deb12u1) …
Processing triggers for man-db (2.11.2-2) …
Pokud chrony běží, zkontrolujte logy:
root@sr650-ext1:~# systemctl status chrony
● chrony.service – chrony, an NTP client/server
Loaded: loaded (/lib/systemd/system/chrony.service; enabled; preset: enabled)
Active: active (running) since Wed 2025-12-31 18:19:35 CET; 57s ago
Docs: man:chronyd(8)
man:chronyc(1)
man:chrony.conf(5)
Process: 2461395 ExecStart=/usr/sbin/chronyd $DAEMON_OPTS (code=exited, status=0/SUCCESS)
Main PID: 2461398 (chronyd)
Tasks: 2 (limit: 463884)
Memory: 1.4M
CPU: 50ms
CGroup: /system.slice/chrony.service
├─2461398 /usr/sbin/chronyd -F 1
└─2461399 /usr/sbin/chronyd -F 1
Dec 31 18:19:35 sr650-ext1 systemd[1]: Starting chrony.service - chrony, an NTP client/server…
Dec 31 18:19:35 sr650-ext1 chronyd[2461398]: chronyd version 4.3 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)
Dec 31 18:19:35 sr650-ext1 chronyd[2461398]: Frequency -18.216 +/- 0.068 ppm read from /var/lib/chrony/chrony.drift
Dec 31 18:19:35 sr650-ext1 chronyd[2461398]: Using right/UTC timezone to obtain leap second data
Dec 31 18:19:35 sr650-ext1 chronyd[2461398]: Loaded seccomp filter (level 1)
Dec 31 18:19:35 sr650-ext1 systemd[1]: Started chrony.service - chrony, an NTP client/server.
Dec 31 18:19:45 sr650-ext1 chronyd[2461398]: Selected source 81.27.192.20 (2.debian.pool.ntp.org)
Dec 31 18:19:45 sr650-ext1 chronyd[2461398]: System clock TAI offset set to 37 seconds
root@sr650-ext1:~# journalctl -u chrony -f
Dec 31 12:07:04 sr650-ext1 systemd[1]: Stopped chrony.service - chrony, an NTP client/server.
Dec 31 12:07:04 sr650-ext1 systemd[1]: chrony.service: Consumed 13.877s CPU time.
Dec 31 18:19:35 sr650-ext1 systemd[1]: Starting chrony.service - chrony, an NTP client/server…
Dec 31 18:19:35 sr650-ext1 chronyd[2461398]: chronyd version 4.3 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)
Dec 31 18:19:35 sr650-ext1 chronyd[2461398]: Frequency -18.216 +/- 0.068 ppm read from /var/lib/chrony/chrony.drift
Dec 31 18:19:35 sr650-ext1 chronyd[2461398]: Using right/UTC timezone to obtain leap second data
Dec 31 18:19:35 sr650-ext1 chronyd[2461398]: Loaded seccomp filter (level 1)
Dec 31 18:19:35 sr650-ext1 systemd[1]: Started chrony.service - chrony, an NTP client/server.
Dec 31 18:19:45 sr650-ext1 chronyd[2461398]: Selected source 81.27.192.20 (2.debian.pool.ntp.org)
Dec 31 18:19:45 sr650-ext1 chronyd[2461398]: System clock TAI offset set to 37 seconds
Chrony používá jako zdroj času některý přednastavený timeserver od Debianu. Pokud chcete nasměrovat synchronizaci na vlastní timeserver, pak takto:
# pool 2.debian.pool.ntp.org iburst
server tik.cesnet.cz iburst
server tak.cesnet.cz iburst
Deaktivoval jsem původní zdroj času a přidal 2 oblíbené timeservery Cesnetu. Restartujte službu chrony a zkontrolujte log:
root@sr650-ext1:~# systemctl restart chrony
root@sr650-ext1:~# journalctl -u chrony -f
Dec 31 18:43:45 sr650-ext1 chronyd[2461398]: chronyd exiting
Dec 31 18:43:45 sr650-ext1 systemd[1]: Stopping chrony.service - chrony, an NTP client/server…
Dec 31 18:43:45 sr650-ext1 systemd[1]: chrony.service: Deactivated successfully.
Dec 31 18:43:45 sr650-ext1 systemd[1]: Stopped chrony.service - chrony, an NTP client/server.
Dec 31 18:43:45 sr650-ext1 systemd[1]: Starting chrony.service - chrony, an NTP client/server…
Dec 31 18:43:45 sr650-ext1 chronyd[2471193]: chronyd version 4.3 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)
Dec 31 18:43:45 sr650-ext1 chronyd[2471193]: Frequency -18.181 +/- 0.049 ppm read from /var/lib/chrony/chrony.drift
Dec 31 18:43:45 sr650-ext1 chronyd[2471193]: Using right/UTC timezone to obtain leap second data
Dec 31 18:43:45 sr650-ext1 chronyd[2471193]: Loaded seccomp filter (level 1)
Dec 31 18:43:45 sr650-ext1 systemd[1]: Started chrony.service - chrony, an NTP client/server.
Dec 31 18:43:49 sr650-ext1 chronyd[2471193]: Selected source 195.113.144.201 (tik.cesnet.cz)
Dec 31 18:43:49 sr650-ext1 chronyd[2471193]: System clock TAI offset set to 37 seconds
Dec 31 18:43:51 sr650-ext1 chronyd[2471193]: Selected source 195.113.144.238 (tak.cesnet.cz)
Z logu je vidět, že chrony nyní čerpá data ze serverů Cesnetu.