Recommended clock source for KVM guests

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,883
1,107
273
To avoid timing issue (slow or too fast clock in a guest) you should make sure you use the right clock source in your KVM guest.

Linux:
The best source clock is the kvm-clock (exist from 2.6.27 and above).
To see what is used, just run in the Linux guest the following command:

Code:
cat /sys/devices/system/clocksource/clocksource0/current_clocksource
Output: kvm-clock

Windows:
Standard acpi HAL uses the rtc clock by default. As long as
you use the -rtc-td-hack it won't drift (-rtc-td-hack is automatically used on Proxmox VE)

When the TSC is not stable on the host or the host cpu might get into
deep sleep state (c2), you better use another source clock in the guest
- for windows it should be the pmtimer (using the boot.ini).

The boot.ini can look like this (here is the boot.ini from a WinXP):
Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /usepmtimer
 
Linux:
The best source clock is the kvm-clock (exist from 2.6.27 and above).

Maybe even earlier than 2.6.27 (at least it's available in Debian Lenny):

Code:
$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
kvm-clock
$ uname -a
Linux dns1 2.6.26-2-686 #1 SMP Wed Aug 19 06:06:52 UTC 2009 i686 GNU/Linux
 
Maybe even earlier than 2.6.27 (at least it's available in Debian Lenny):

Code:
$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
kvm-clock
$ uname -a
Linux dns1 2.6.26-2-686 #1 SMP Wed Aug 19 06:06:52 UTC 2009 i686 GNU/Linux


What about FreeBSD guests?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!