Disabling Time Synchronization for virtual machines
search cancel

Disabling Time Synchronization for virtual machines

book

Article ID: 326306

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

In the VMware Tools control panel, the time synchronization checkbox is unselected, but you may experience these symptoms:

  • When you suspend a virtual machine, the next time you resume that virtual machine it synchronizes the time to adjust it to the host.
  • Time is resynchronized when you migrate the virtual machine using vMotion, take a snapshot, restore to a snapshot, shrink the virtual disk, or restart the VMware Tools service in the virtual machine (including rebooting the virtual machine).


Resolution

VMware Tools can perform two types of time corrections:

  • Periodic time sync: The guest operating system clock is periodically (every 60 seconds) synchronized to track host time. It is recommended that guests use a native time synchronization service – such as NTPD or Chrony in Linux based operating systems, and W32Time for Microsoft Windows. If that's not viable, periodic time sync provides an alternative. This capability is turned off by default.
  • One-off time sync: The guest operating system clock is synchronized to host time upon specific VM life-cycle events that can cause guest clock to become incorrect, such as resuming from vMotion or a snapshot/consolidation etc. This capability is recommended for use and turned on by default.

VMware Tools does not set time backwards (when guest time is ahead of the host), except once when periodic time synchronization is turned on.

 

vSphere 7.0 U1 and above

 

In vSphere 7.0 Update 1 and later version, the VMware Tools menu in the Edit Settings Wizard for a virtual machine provides two check-boxes, which allow to enable or disable one-off time synchronization and periodic time synchronization:

To disable periodic time synchronization in a VM, launch vSphere Client, go to Edit Settings →  VM Options →  VMware Tools → Synchronize Time with Host, and deselect the checkbox Synchronize time periodically.

The vmx option for this setting is tools.syncTime and its value can be "TRUE" when periodic time sync is enabled, or "FALSE" when periodic time sync is disabled.


To disable one-off time synchronization in a VM, launch vSphere Client, go to Edit Settings →  VM Options →  VMware Tools → Synchronize Time with Host, and deselect the checkbox Synchronize at startup and resume (recommended). Disabling one-off time synchronization as described will also automatically force disable periodic time synchronization.

This setting is managed with the vmx option time.synchronize.allow. By default, when one-off time synchronization is enabled, the option has the value "TRUE", but is not contained in the vmx configuration file. When one-off time synchronization is however disabled, you can find this option in the vmx configuration file with the value "FALSE".
 

Workstation, Fusion, or before vSphere 7.0 U1

VMware Workstation, Fusion, and vSphere prior to version 7.01 U1 provide a single checkbox in a VM's VMware Tools control panel, which enables or disables periodic time synchronization only.

To disable periodic time synchronization in a VM, launch vSphere Client, go to Edit Settings →  VM Options →  VMware Tools → Time, and deselect the checkbox Synchronize guest time with host

To disable one-off time synchronization in a VM, you must set the following advanced configuration settings.
 

time.synchronize.continue = "FALSE"
time.synchronize.restore = "FALSE"
time.synchronize.resume.disk = "FALSE"
time.synchronize.shrink = "FALSE"
time.synchronize.tools.startup = "FALSE"
time.synchronize.tools.enable = "FALSE"
time.synchronize.resume.host = "FALSE"

VM advanced settings can be modified using vSphere client or by editing the VM's .vmx file.  See the following articles for more information:

These advanced VM settings do not take effect until the VM (or VMware Tools running within it) is restarted.

Additional Information

The steps described above for disabling time synchronization apply ONLY to the behavior and impact of the time synchronization feature of VMware Tools running inside a VM. The guest operating system in the VM may rely on additional sources of wall clock time information for general timekeeping. Guest OSes typically read virtual CMOS/RTC clock to bootstrap system time during start up. On VMware, time on the virtual CMOS/RTC clock is derived from the host's time, at an offset established at first power-on (or when the guest OS writes back to CMOS). If subsequently, the host clock is modified to an incorrect value, or if the VM is migrated to a host with incorrect UTC time, the guest will derive a corresponding incorrect notion of wall time at start up. Disabling VMware Tools time synchronization with the host does not avoid this scenario. Therefore, it is important to always configure all ESXi hosts to synchronize time to one or more external, reliable sources of time.

Attachments

Disabling Time Synchronization for virtual machines.jpg get_app