4
votes

In Linux I am spawning a guess VM and load another instance of Linux. VM is spawned through KVM/libvirt/qemu. Guest VM is seen as a process by the host kernel. Lets say for some reason the guest VM QEMU process doesn't get scheduled for sometime.. how does the kernel in the VM maintain time ? Lets say I have a timer in my application in the guest VM. If the guest VM qemu process itself doesn't get scheduled will it affect my timer expiry ?

1

1 Answers

1
votes

Some virtualization solutions have the VM clock(s) hooked to some host clock(s), so that the VM clock does not tick independently. In other cases, no such thing may occur (relying on an emulated interrupt clock for example), which then does lead to clock skew. The wall clock skew you can attempt to combat with ntpd, but for things like CLOCK_MONOTONIC, you will probably have to live with it.