I am running a few Ubuntu VMs on a MacBook Pro host.
Whenever I pause a VM or save its state to disk, the next time I restart it, the system clock goes out of sync.
Is there a way for the VM to know it has just been resumed, and run a command? (for example, running ntpdate -u time.nist.gov
as root would do the trick)
I tried modifying the scripts in /etc/pm/sleep.d
, but these don't appear to be called on VM suspend/resume.
Answer
For this particular use, the Guest Additions is supposed to synchronize the VM's clock automatically. (See "Time synchronization" at http://www.virtualbox.org/manual/ch04.html, or if you want to customize it, http://www.virtualbox.org/manual/ch09.html#changetimesync.) It's possible that this updating might have stopped working when using an older version of the guest additions than the VirtualBox version on the host.
To install or update the Guest Additions, mount the Guest Additions CD image using the relevant menu command on the host, and run the script from the CD on the guest. For details see the directions at http://www.virtualbox.org/manual/ch04.html#idp11850096.
No comments:
Post a Comment