Windows time drifting with Qemu/KVM

Jochen picture Jochen · Nov 29, 2013 · Viewed 8.2k times · Source

I have a Windows VM running with kvm/qemu which is experiencing time drift. What would be the optimal libvirt settings for a Windows guest?

Currently I am using this, but it did not help:

<clock offset='localtime'>
  <timer name='rtc' tickpolicy='catchup' track='guest'>
    <catchup threshold='123' slew='120' limit='10000'/>
  </timer>
</clock>

Answer

Jochen picture Jochen · Nov 30, 2013

This did the trick for me:

<clock offset='localtime'>
  <timer name='rtc' tickpolicy='catchup' track='guest'/>
  <timer name='pit' tickpolicy='delay'/>
  <timer name='hpet' present='no'/>
</clock>

you also need to make sure Windows uses the platformclock when booting:

bcdedit /set USEPLATFORMCLOCK on