Linux running under Virtual Server 2005

image Recently we decided to put up a virtual Linux server in one of our hosting environments. The host machine is a Windows Server 2003 x64 edition running Virtual Server 2005 R2 x64 SP1. We chose to install CentOS 5.1 which is community Linux distribution based on Red Hat Enterprise Linux (RHEL).

The installation went perfectly fine but I noticed that the system time was going way too fast. So the first thing I did was configure ntpd to synchronise the system time with an NTP time source. Unfortunately after about 12 hours the time was still about 40 minutes out, obviously traditional time synchonisation was not going to cut it. After a bit of searching I found this knowledge base article on the Linux kernel 2.6 clock source. I set the kernel option clock=pit which configures the Linux kernel to use the programmable interrupt timer, only to find that now the clock was too slow. Could it get any worse!

Then I recalled that Microsoft had been working on virtual machine additions for Linux and that one of the features was time synchronisation. Unfortunately they only officially support Red Hat and SuSE Linux so I took a long-shot and installed them anyway. I had to manually force install the RHEL RPM but it worked and now the time is perfectly synchronised with the host server – which of course is already NTP synchronised to the hosting environment’s NTP server.

[tags]Virtual Server 2005,Linux,CentOS,NTP,time synchronisation[/tags]