On 2014-07-02 20:06, wolfi323 wrote:
> Of course, while the VM is suspended, the (virtual) clock does not
> continue to run.
> If you restore the VM, the clock continues at the point where it has
> been suspended, so has a time in the past.
Right.
> Linux will only synchronize to the hardware clock at boot anyway,
Er… no, it also does on restore from hibernation.
However, I see an issue: if you request the guest operating system to
hibernate, it will know on restore that it has to jump the clock.
However, if you tell virtualbox to hibernate the machine, the guest
knows nothing. At least it is so with vmware.
(In the first method, the image is stored in the swap partition of the
emulated hard disk. In the second method, the image is a memory map file
in the vmware image directory, outside. And by the way, the first method
crashes).
> so it
> doesn’t matter whether the virtual hardware clock is set correctly
> afterwards or not. So even if VirtualBox would set the hw clock
> correctly when resuming (I don’t know if it does), it would have no
> effect for the running guest system (which doesn’t even know/recognize
> that it has been suspended).
Maybe… with the traditional cpu time keeping method, you are
absolutely correct. With some of the new timers, I’m not sure, they
could be rewritten. It could crash the guest, though.
> There’s no way around that I suppose, unless using ntp or time
> synchronization.
Guest tools do that, but they take some time to kick in. Ntp is no no,
but you can call a one-shot time adjustment instead.
> Actually that’s the only reason why that synchronization would be needed
> I think, as otherwise the clocks should not get out of sync anyway.
But not attempting to adjust the timer speed on the guest. The older
method, via cron calls instead.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)