Configuring chronyd to use a PTP hardware clock
Published (last updated )
Red Hat Enterprise Linux 7.5 and later provide a virtual PTP hardware clock, which enables the guests to synchronize to the host with a sub-microsecond accuracy, see:
To enable the PHC device, do the following inside a virtual machine:
- Set the ptp_kvm module to load after reboot:
echo ptp_kvm > /etc/modules-load.d/ptp_kvm.conf - Add the /dev/ptp0 clock as a reference to the chrony configuration:
echo "refclock PHC /dev/ptp0 poll 2" >> /etc/chrony.conf - Restart the chrony daemon:
systemctl restart chronyd - To verify the host-guest time synchronization has been configured correctly, you can use the chronyc sources command on a guest:
chronyc sources