Clock update fails when restoring Windows guests from disk
After installing the QEMU Guest Agent for Windows (qemu-ga
), which is included in the Fedora Windows VirtIO Drivers, on a vanilla Windows 10 guest, and enabling the org.qemu.guest_agent.0
socket on the VM using virsh edit
, the following debug message is shown by Boxes
when restoring the VM from disk:
(gnome-boxes:2): Boxes-DEBUG: 12:43:41.064: libvirt-machine.vala:652: Failed to update clock on Microsoft Windows 10: Unable to set domain time: internal error: unable to execute QEMU agent command 'guest-set-time': Windows Time service not running on the guest
The user experience is that the guest machine's clock remains wrong until an NTP update is triggered, which may take up to an hour. During that time, network operations that require the clock to be synchronized may fail.
This limitation is documented by QEMU:
Command: guest-set-time
Set guest time.
When a guest is paused or migrated to a file then loaded from that file, the guest OS has no idea that there was a big gap in the time. Depending on how long the gap was, NTP might not be able to resynchronize the guest.
This command tries to set guest’s System Time to the given value, then sets the Hardware Clock (RTC) to the current System Time. This will make it easier for a guest to resynchronize without waiting for NTP. If no time is specified, then the time to set is read from RTC. However, this may not be supported on all platforms (i.e. Windows). If that’s the case users are advised to always pass a value.