Update, August 2010
Note that allegedly this is all more or less depreciated. Kernels later than those provided in 5.2 have more vm-aware stuff in them; therefore there's less a requirement to mess around with this. I have found that CentOS 5 VMs based on 5.4 or later only lose time if the VM host is overloaded somehow. For "routine" virtualization, there shouldn't be any problems running NTP with a stock installation.
VMware Solution
See
this page for VMware's take on how to deal with this. This appears to be the preferred solution, rather than what is below.
Problem
I have VMware Server 1.0.6 installed on a Windows 2003 server. I have CentOS 5.1 installed into a VM. The clock on my CentOS 5 system is incredibly bad (ie loses 30 seconds per minute bad).
Most recent recipe
- Disable cpuspeed and friends on host OS (for Linux hosts)
- Kernel from
http://vmware.xaox.net/centos/ (alternatively: try the boot kernel option divider=10 for CentOS 5 guests (Warning: I hosed at least one VM by using this kernel options line. The VM would answer pings but ran so slowly and erratically that it would not hold a network connection so we couldn't SSH into it to fix it))
- See Installing vmware-tools on CentOS
- Boot with kernel options:
ro quiet clocksource=pit nosmp noapic nolapic
Commentary
See the various VMware links I've been accumulating at
http://del.icio.us/xdroop/vmware
Alleged Solution
- See Installing vmware-tools on CentOS
- Add to the kernel line in your grub.conf
- Now on your HOST, edit your guest's .vmx file and change the line from: to "TRUE". In mine, it's the last line in the .vmx file.
# vmware-cmd /path/to/machine.vmx getconfig tools.syncTime
- Restart the VM.
You still can't run ntp in the VM, but things should be much less bad.
(
Ref)
Update: this doesn't work. The kernel magic is
and there's no such parameter in the client .vmx file. So it doesn't work.