System clock runs fast in a Linux guest Virtual Machine

Issue

A Linux guest virtual machine continually gains time.

The hardware clock is showing the correct time:

hwclock --show


VMware Tools are installed in the guest OS, and the following option is present in the .vmx file:

tools.syncTime = "TRUE"


Adding the following kernel command line option does not resolve the issue:

clock=pit

Resolution

Use the ACPI Power Management Timer with the following kernel command line option:

clock=pmtmr


Note: From kernel 2.6.16 the clock= command line option is deprecated and the following option should be used:

clocksource=acpi_pm


The following option may be better suited to a Linux guest with kernel 2.6.21 or later and to VMware products such as VMware Workstation 6 that provide "VMware paravirtual kernel support":

clocksource=vmi-timer


The following document lists a per distribution/version of VMware recommended kernel parameters:

Timekeeping best practices for Linux guests
http://kb.vmware.com/kb/1006427

References

Check the current kernel command line clock parameter with the command:

dmesg | grep clock


If the tools.syncTime = "TRUE" is not set, shut down the virtual machine, add the tools.syncTime = "TRUE" line to the .vmx file, either by editing the file or by using Edit Settings | Options tab | Advanced setting | Configuration Parameters button in VirtualCenter Client, and restart the virtual machine.

Time: Clocksource Infrastructure
clock={ pit | tsc | cyclone | pmtmr }
clocksource={ jiffies | acpi_pm | pit | hpet | tsc | vmi-timer }
http://lkml.org/lkml/2006/3/17/360

Timekeeping in VMware Virtual Machines
http://theether.net/download/VMware/vmware_timekeeping.pdf

Products

VMware ESX 3

Created: 7th August 2007
Updated: 22nd July 2010


© 2005-2019 Jamie Morrison