[ntp:questions] Win7: ntpd adjusting time backwards

Jeroen Mostert jmostert at xs4all.nl
Thu Dec 13 20:27:02 UTC 2012


On 2012-12-13 09:53, Mischanko, Edward T wrote:
> I have always read that NTP should not be run Virtual Machines.  NTP should
> only be running on the "Real" machine with a hardware system clock. If the
> hardware machine is in synch, then the VM on the hardware machine should also
> be in synch.

That can only work if there's some sort of driver or integration patch that 
makes the guest OS retrieve its time directly from the host's hardware clock. 
Otherwise, the guest OS maintains its own notion of time based on whatever 
hardware is being virtualized.

In the case of Windows on VMWare (which is what I'm using), Windows simply 
maintains time just like it does on actual hardware, which is by taking the 
initial time from the CMOS and then maintaining ticks with timer interrupts. 
VMWare will simply emulate the interrupts, but Windows keeps its own time. Thus 
the guest OS clock is subject to losing or gaining ticks depending on the 
hypervisor's scheduling, which has nothing to do with the host's clock.

VMWare has a feature that integrates time synchronization with the guest OS, but 
this is not meant as an accurate timekeeper, just as a stopgap measure for 
keeping up the clock if the VM lags behind too far. It will look once every 
minute to see if the guest is too far behind, and if it is, it will simply step 
the clock to the "correct" time. This is far more crude than what ntpd does.

It's still important to keep the host clock synchronized as well, to make sure 
the VM has accurate time if it's turned off or migrated to another host in the 
cluster, but (at least in the case of VMWare) you cannot count on the host clock 
to keep the guest clock accurate to the kind of accuracy that NTP can achieve. 
VMWare has a whitepaper covering it in more detail, see 
http://www.vmware.com/files/pdf/techpaper/Timekeeping-In-VirtualMachines.pdf.


-- 
J.



More information about the questions mailing list