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


Resolution

The term Time Drift describes situations where the reported time diverges from the correct time at an approximately constant rate.

For ESX:
  1. Log into the host through an SSH session. For more information, see Connecting to an ESX host using an SSH client (1019852).
  2. Run cat file/var/lib/ntp/drift to see the time drift.

For ESXi 5.x:
  1. Log into the host through an SSH session. For more information, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
  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 ESX\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 ESX\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.

For more information see, Timekeeping best practices for Windows, including NTP (1318).

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.


Additional Information

Severe hardware time drift may be caused by the hardware HPET mis-reporting its frequency. For more information, see Confirming HPET is not misreporting its frequency (1006090).
Forward time drift in virtual machines running Windows may also be caused by problems with the Windows Multimedia timer. For more information, see Time runs too fast in a Windows virtual machine when Multimedia Timer interface is used (1005953).
Using Tech Support Mode in ESXi 4.1, ESXi 5.x, and ESXi 6.x
Connecting to an ESX host using an SSH client
Timekeeping best practices for Windows, including NTP
ハードウェア タイマーのドリフト(進みまたは遅れ)が原因で仮想マシンの時刻がずれる
虚拟机中的时间因硬件定时器偏移而出现偏移