VirtualBox – Ubuntu VM Doesn’t Sync Time with Host

guest-additionssyncubuntu 12.04virtual machinevirtualbox

I'm running a Ubuntu VM with VirtualBox and I have both the dkms and virtualbox-guest-additions packages installed. I read in this answer that the system clock should sync with the host automatically with the Guest Additions, but mine doesn't seem to be doing that. What are some possible reasons / how do I rectify this? I've tried searching for this all over but most of the hits I get off Google tell you how to disable the automatic time sync, not enable it.

My host machine is running OS X 10.8, if that's of any help.

Best Answer

Turns out I needed to install the ntp package, in addition to the two others I mentioned above.

The date/time after I woke my computer up from sleep:

$ date
Wed Sep 25 12:50:25 EDT 2013

Then, to correct it:

$ sudo service ntp stop
 * Stopping NTP server ntpd                          
$ sudo ntpdate pool.ntp.org
25 Sep 13:22:45 ntpdate[15379]: step time server 109.169.89.48 offset 1880.691920 sec
$ sudo service ntp start
[sudo] password for yiqing: 
 * Starting NTP server ntpd  

Now synced to the real date/time:

$ date
Wed Sep 25 13:23:07 EDT 2013

Once I rebooted, I found that my VM's system clock synced to my host as desired.

Related Question