VirtualBox Ubuntu VM doesn't automatically sync time with host even with Guest Additions installed

15

5

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.

3cheesewheel

Posted 2013-09-24T13:24:52.417

Reputation: 662

1What version of Ubuntu and what version of Virtualbox are you using? One would think the tutorial on how to disable could be used to enabled it by changing a single step. Can you link to one such guide? – Ramhound – 2013-09-24T13:33:17.443

I'm using Ubuntu 12.04 and VirtualBox 4.2.18. I initially followed this small post to install Guest Additions. I know what you mean, my suspicion is also that the answer is very simple, but I can't seem to find it anywhere.

– 3cheesewheel – 2013-09-24T13:49:54.700

Answers

20

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.

3cheesewheel

Posted 2013-09-24T13:24:52.417

Reputation: 662

6"I found that my VM's system clock synced to my host as desired"

Not to your host but to an external NTP server - there is a big difference, this approach requires network connectivity for the guest system whereas VirtualBox tools can accomplish actual time sync from host system without network connectivity. – geekuality – 2015-06-09T13:32:19.720