
As I have installed and administrated a bunch of Linux servers as virtual machines, I have had trouble keeping the time correctly. There is always a small drifting going on in virtual machines and a number of different ways to keep them synchronized with the host operating system.
Nowadays I have left that struggle behind letting the virtual guests keep themselves and their clocks correctly set.
The problem
The problem with keeping the clocks in the guest systems correctly set comes with the fact that their CPU is a virtual one and therefore the host software tries to compensate for that. Most of the guests running on VMWare server will drift. I have had installation drifting about 20 minutes over a 24 h period.
The solution
When dealing with Ubuntu Servers as guest operating systems the solution is easy. Just install an NTP (Network Time Protocol, http://www.ntp.org) daemon, configure it correctly and let it do its work.
The installation in Ubuntu server is really straight forward. Just execute the following to install the NTP daemon:
sudo apt-get install ntp
Now, configure the NTP daemon using your favorite editor:
sudo editor /etc/ntp.conf
Look for the server stuff and add up to three servers close to where the server is located:
server se.pool.ntp.org
server fr.pool.ntp.org
server uk.pool.ntp.org
I’ve added the time servers located in Sweden, France and the UK.
Now restart the NTP daemon:
sudo /etc/init.d/ntp restart
and let it be for a while. The daemon will kick in and the system clock will be in synchronized with the time servers. Be patient waiting for the daemon to work! The daemon exchanges message with the time servers at intervals ranging from 1 up to 17 minutes. The initial delay can be set using startup parameters, but they are not covered here.
If you run VMWare server on a Ubuntu server the host will be synchronized using the same procedure.
Read more
Read more about NTP here:
Time servers for public use can be found here: