Guest Time Keeping in Windows under KVM Virtualization:
Virtualization poses various challenges for guest time keeping. Generally - Guests using the Time Stamp Counter (TSC) as a clock source generally suffer timing problems as some CPUs do not have a constant Time Stamp Counter.
I believe this is what is happening to you.
To clarify for others reading this post - guest systems without accurate timekeeping may have issues with some networked applications and processes as the guest will run faster or slower than the actual time and fall out of synchronization.
KVM works around this issue by providing guests with a para-virtualized clock. Alternatively, some guests may use other x86 clock sources for their timing in future versions of those operating systems.
To determine if your CPU has a constant Time Stamp Counter run the following command:
$ cat /proc/cpuinfo | grep constant_tsc
If any output is given your CPU has the constant_tsc bit.
Chances are however yours does not - and thus the issues your running into - therefore another work around / alternative is to first turn off any power management in the BIOS - as well as in the KVM.
It is also important to note that Windows uses the both the Real-Time Clock (RTC) and the Time Stamp Counter (TSC).
Older systems such as Windows 2003 and XP use the boot.ini file however -
The boot.ini file is no longer used from Windows Vista and newer.
Windows 2008, Vista and 7 Booot Configuration Editor:
Windows Vista, Windows Server 2008 and Windows 7 use the Boot Configuration Data Editor (bcdedit.exe) to modify the Windows boot parameters.
- Open the Windows guest.
- Open the Accessories menu of the
start menu. Right click on the
Command Prompt application, select
Run as Administrator.
- Confirm the security exception, if
prompted.
Set the boot manager to use the
platform clock. This should instruct
Windows to use the PM timer for the
primary clock source. The system
UUID ({default} in the example
below) should be changed if the
system UUID is different than the
default boot device.
C:\Windows\system32>bcdedit /set {default} USEPLATFORMCLOCK on
The operation completed successfully
Windows 2003 and XP Boot Configuration Edit:
If by chance you are looking at this post - but the issue exists on your Windows XP and/or Windows 2003 system add the following line to the Windows boot settings. In XP and Server 2003 Windows boot settings are stored in the boot.ini file. Add the following line to the boot.ini file:
/use pmtimer
I really hope this helps.
Blessings,
Glenn Kelley