Set windows time

Hi All

I am using ubuntu 22.04 and lxd on my laptop.
By the way, I installed windows with vm, but the time of vm is different from the current time.

Even if I set the time manually, the time is wrong when I reboot the vm.
What should I do?


I’ve seen the same effect here though you can usually convince Windows to synchronize the time from an internet source to sort this out.

My best guess is that QEMU sets the firmware clock to the time in UTC whereas Windows expects it to be set in the local timezone.

The vm’s bios looks like the screen below.
Where do I set the time? Can’t seem to find it.

I have set the time in the BIOS of the laptop, but it is still not correct.

You can’t. Firmwares never really did timezones and virtual machines never did clocks.

On a physical system, you have a clock crystal combined with a chip that keeps track of time.
This can then get altered by the user through the BIOS screens or from the OS.
Unless you remove the battery keeping it ticking, time keeps progressing even with the system off.

There’s no such thing with virtual machines. With VMs, instead, the hypervisor (QEMU) sets up the virtual timer on startup, aligning it with the host system. Because Linux normally tracks its physical time without timezones (UTC), then that’s what gets pushed to the VM on startup.

Apparently Windows stores the region specific time rather than use UTC and applying an offset, which then causes this issue.

There’s apparently a Windows registry key called RealTimeIsUniversal which can be set to 1 so Windows knows that the hardware clock is UTC.