Time in virtual machine drifts due to hardware timer drift
search cancel

Time in virtual machine drifts due to hardware timer drift

book

Article ID: 310305

calendar_today

Updated On:

Products

VMware VMware Desktop Hypervisor VMware vSphere ESXi

Issue/Introduction

Symptoms:

  • Time in a virtual machine drifts because the hardware time source used by the virtual machine monitor drifts.
  • Time in a virtual machine drifts at a constant rate.



Environment

ESXi version 6.x
ESXi version 7.x
ESXi version 8.x

Resolution

The term Time Drift describes situations where the reported time diverges from the correct time at an approximately constant rate.
 
 
  1. Log into the host through an SSH session. For more information, see Remote ESXi Shell Access with SSH (vmware.com)
  2. Run cat /etc/ntp.conf . Make note of the path of the drift file.
  3. Run cat path_of_drift_file to see the time drift.
In this file you will see the time drift from the NTP server. For example, -130.824 means that the hardware is running about 130 parts per million (PPM) fast. Similarly, 45.253 indicates that the hardware clock is running about 45 PPM slow.
 
Note: This check only applies to ESXi. For other products such a Workstation and Server, the hardware clock used by the host operating system may not correspond to the hardware clock used by the virtual machine monitor to drive the virtual time devices.
 
All hardware timers run at a slightly different rate than their specified frequency. Operating systems are already designed with this in mind and generally run software to correct for this drift, like NTP or w32time. Because of this, the virtual machine monitor does not attempt to correct the drift of the hardware that it uses for determining the time. This results in the hardware drift being passed on to the guest operating system.

On ESXi, running NTP in the Service Console corrects time in the Service Console, but does not affect the time used by the virtual machine monitor and the guest operating system depending on VMware Tools settings.


Similarly, on Workstation, Server, Player, Fusion, and ACE, running NTP, w32time or other time synchronization software on the host operating system corrects time on the host, but does not affect the time used by the virtual machine monitor and the guest operating system.

Run time correction software in the guest operating system. Options include NTP, w32time, or VMware Tools periodic time synchronization.

Note: If the time drift is forward, VMware Tools periodic time synchronization does not properly correct it and NTP or w32time must be used.