For When You Can't Have The Real Thing
[ start | index | login ]
start > VMware > Server > Clock on CentOS

Clock on CentOS

Created by dave. Last edited by dave, 13 years and 228 days ago. Viewed 17,552 times. #11
[diff] [history] [edit] [rdf]
labels
attachments

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

  1. Disable cpuspeed and friends on host OS (for Linux hosts)
  2. 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))
  3. See Installing vmware-tools on CentOS
  4. 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

  1. See Installing vmware-tools on CentOS
  2. Add
    clock=pit
    to the kernel line in your grub.conf
  3. Now on your HOST, edit your guest's .vmx file and change the line from:
    tools.syncTime = "FALSE"
    to "TRUE". In mine, it's the last line in the .vmx file.
    # vmware-cmd /path/to/machine.vmx getconfig tools.syncTime
  4. 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

clocksource=pit
and there's no such parameter in the client .vmx file. So it doesn't work.
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt