How to keep time on resumed KVM guest with libvirt?

Posted by Hristo Hristov on Server Fault See other posts from Server Fault or by Hristo Hristov
Published on 2011-11-25T07:47:25Z Indexed on 2011/11/25 9:53 UTC
Read the original article Hit count: 283

On my host I am using libvirt and a KVM guest. When the host is shutting down, libvirt suspends the guest. When the host is starting up, libvirt resumes the guest. The problem is, if the guest is suspended and resumed after 24 hours for example, then the guest time is 24 hours in the past.

I thought that maybe the problem is with the clocksource, but it is set to "kvm-clock" already.

$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
kvm-clock tsc hpet acpi_pm 

$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
kvm-clock

© Server Fault or respective owner

Related posts about virtualization

Related posts about kvm