Wednesday, October 3, 2007

Ubuntu Host with Windows Guest Time Sync Problem

I've been running VMware server for 3-4 months on an Intel Duo Core 2 with Ubuntu Fiesty Fawn as my host OS. My windows guests would always run too fast and every article I could find about time sync issues only showed how to change the boot clock variable to clock=pit or clock=pmtmr under grub or lilo.

The problem and fix are different from what this vmware knowledgebase article. Clock in a Linux Guest Runs More Slowly or Quickly Than Real Time

This is the correct knowledgebase article from vmware. Host Power Management Causes Problems with Guest Timekeeping (Windows Hosts)

==============================================

Quick Solution Steps

Install cpufrequtils and run cpufreq-info to get maximum frequency

Autoedification: VMware guest clock runs fast
Since my max CPU is 1.83 GHz, I added these lines to
/etc/vmware/config:

host.cpukHz = 1830000
host.noTSC = TRUE
ptsc.noTSC = TRUE

==============================================

Unfortunately, you will have to modify this file every time you run vmware-config to recompile the vmware modules for a new kernel.  I'm going to keep a copy under /etc/vmware/config.bak and run a quick 'sudo cp /etc/vmware/config{.bak,}'  after every time I need to recompile.