Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 wp on lamp install in virtual machine. I frequently pause it, save snapshots, etc. Date and time aren't correct because of this and i think i noticed weird behavior of plugins that use cron. How do i fix my time and plugins? Maybe i should get time from external location so it would be correct even though i regularly pause my machine?

It's Debian Lenny guest on other linux host. I'm using virtualbox.

share|improve this question
what virtualization technology are you using? – jeff Aug 13 '09 at 18:30
virtualbox (hmmm 15 characters minimum ;) – Phil Aug 13 '09 at 22:02
up vote 4 down vote accepted

What you need is Time Synchronization, which is a feature of the Guest Additions in Virtual Box. Looks like it wasn't installed. From the Virtualbox manual:

Time synchronization With the Guest Additions installed, VirtualBox can ensure that the guest’s system time is better synchronized. This fixes the problem that an operating system normally expects to have 100% of a computer’s time for itself without interference, which is no longer the case when your VM runs together with your host operating system and possibly other applications on your host. As a result, your guest operating system’s timing will soon be off significantly. The Guest Additions will re-synchronize the time regularly.

Install instructions here.

share|improve this answer

To syncronise time, use NTP (Network time protocol).

Firstly, sync time with

sudo ntpdate

Then, install ntpd sudo apt-get install ntp

share|improve this answer
This isn't really what you want. You want your host machine synchronized with NTP and you want your guest synched to your host. Otherwise, they guest time will be jumping all over the place. – user17642 Aug 24 '09 at 16:49

VMs don't always play well with ntp.

If you are using VMware, install the VMware tools. Then, there is a setting in the .vmx file called time.syncTime that should be set to TRUE (although the time seems to be staying sync'd since I install VMware Tools even set to the default FALSE).

Here are some other VMware settings: (from

  • tools.syncTime If set to TRUE, the clock syncs periodically.
  • time.synchronize.continue If set to TRUE, the clock syncs after taking a snapshot.
  • time.synchronize.restore If set to TRUE, the clock syncs after reverting to a snapshot.
  • time.synchronize.resume.disk If set to TRUE, the clock syncs after resuming from suspend and after migrating to a new host using the VMware VMotion feature.
  • time.synchronize.shrink If set to TRUE, the clock syncs after defragmenting a virtual disk.
  • If set to TRUE, the clock syncs when the tools daemon starts up, normally while the guest operating system is booting.
share|improve this answer
man 8 hwclock

or add this to root's crontab in the virtual machine

*/1 * * * *  hwclock --hctosys
share|improve this answer
but hardware clock will be guest 'hardware' clock, i guess? so not what i'm looking for? – Phil Aug 27 '09 at 18:04

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.