0

recently I noticed that the clock on this RHEL system running on a VMWare guest has gone seriously out of sync (uptime is about half a year):

$ timedatectl
      Local time: Sun 2021-11-07 09:54:12 CET
  Universal time: Sun 2021-11-07 08:54:12 UTC
        RTC time: Sun 2021-11-07 08:59:27
       Time zone: Europe/Berlin (CET, +0100)
     NTP enabled: no
 NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2021-10-31 02:59:59 CEST
                  Sun 2021-10-31 02:00:00 CET
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2022-03-27 01:59:59 CET
                  Sun 2022-03-27 03:00:00 CEST

I believe the RTC is actually the system clock of the VMWare host, and it is in fact correct and the local time is five minutes late. The administrator of the VMWare host had told me that I shouldn't use ntpd or chrony *) to keep the clock in sync but rather rely on the host clock. And it's what I thought I was doing all along:

$ vmware-toolbox-cmd timesync status
Enabled

So why isn't the system clock in sync?

The VMWare documentation says:

When you enable periodic time synchronization, VMware Tools sets the time of the guest operating system same as the host time. After time synchronization occurs, VMware Tools checks once every minute to determine whether the clocks on the guest and host operating systems still match. If not, the clock on the guest operating system is synchronized to match the clock on the host.

You may ask, since there is a "VMWare host administrator", why don't I just take up the issue with him? Of course I will do that. I'm just curious about what's going on here.

*) That was about a year ago when I noticed my system clock skipping all over the place. Turned out I had accidentally both ntpd and chrony active. The VMWare admin figured out the problem and told me to use neither but just rely on the host clock using vmware-toolbox-cmd.

1 Answer 1

1

Configure chrony (or ntpd) on the guest with the NTP servers your organization uses. Restart, wait 3 minutes for the first few packets.

If local time remains significantly different than RTC, the VM host's clock is likely wrong. Five minute offset that you have now is definitely large. Ask the hypervisor administrator to confirm NTP servers set on the VM hosts are the same as what your organization uses throughout the network.

NTP can continue to run in guests, and has better performance than guest time sync. Although you may choose to stop ntpd, once the mystery of the offset clocks is solved.

1
  • I simply installed chrony (using my organisation's timeserver), everything is perfectly in sync now, and I stopped caring. The VM host's clock (which I understand to be the guest's "RTC clock") is fine, it just doesn't get synchronized despite the vmware-toolbox-cmd setting.
    – musbur
    Nov 11, 2021 at 19:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .