Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu Karmic on a VM with VirtualBox 3.2.8 (I need to update...) and I've just noticed that the system time on my VM is out of sync with the real world.

It seems that the time will synch properly if I reboot the machine, presumably because my laptop is being used as a surrogate BIOS and so it grabs the time from there on boot, but if I just "save" the machine when I'm not using it, the VM doesn't notice that real-time has passed while it was saved.

Is there any way that I can trigger the system to resynch its system time when it wakes up, or do I have to get used to "properly" shutting down the machine?

I run my SVN repository on the VM, so my logs are wrong for a lot of my revisions now. Not a big deal I guess, but it's definitely something I'd like fixed.

share|improve this question
up vote 2 down vote accepted

Have you got guest additions installed? One of the things this does is keep the system time in sync with the host.

share|improve this answer
I just tried that to be sure (can't remember if I did it on this machine before or not), and nothing happened. This is Ubuntu Karmic Server, not desktop, if that matters. – AgentConundrum Dec 5 '10 at 19:30
Found this to explain installing guest additions on server – AgentConundrum Dec 5 '10 at 19:36

I have the same question and found this very helpful, restart the syn daemon and the guest time will syn with host:

sudo /etc/init.d/vboxadd-service restart
share|improve this answer

You can use ntpd for synch time with a Time Server on internet like ...

share|improve this answer
I should have been more clear. I'm looking for a way to trigger this when the VM wakes up. It might be impossible, but the only other choices I have would be to either run it as a cron job every couple minutes, or (just thought of this) write a commit hook for svn. – AgentConundrum Dec 5 '10 at 19:12

xntpd should provide adequate date sync - ubuntu provides an admin interface to enable ntp functionality

share|improve this answer
Since ntpd was designed to keep machines in sync in a stable manner, it slowly corrects any time differences. So, if the time is more than 1000s (~16.6m) off, it assumes something is terribly wrong and exits. See the man page for ntpd for more information. – Scott Pack Dec 5 '10 at 19:53

I am in mostly the same boat as you are. I have a VMware guest that I have running at all times inside a MacOS host on my MacBook. When I put my laptop to sleep, and wake it up, the date and time on the VMware guest is of course out of sync. I have created a small script file which calls ntpdate to sync the time on the guest. I run that script as sudo every time I access the guest after a sleep/wake cycle.

The script is as simple as this:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.