[[howto:virtualization:fix-drifting-clock-in-vmware-linux-host-windows-guest]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howto:virtualization:fix-drifting-clock-in-vmware-linux-host-windows-guest [2018-08-05 04:25] (current)
Line 1: Line 1:
 +~~META:
 +creator = Brendan Kidwell
 +&date created = 2007-12-28
 +~~
 +{{tag>​clock linux virtualization vmware windows}}
 +~~DISCUSSION~~
 +====== Fix Drifting Clock in VMWare (Linux Host, Windows Guest) ======
 +
 +I have a Windows virtual machine on my office computer running in VMWare Server. The real computer runs Ubuntu Linux. I've had a nagging problem with the clock in the virtual machine. It always registers the correct time when I boot up the virtual machine, but then it invariably drifts -- sometimes hours in single work day. I can't remember whether it drifts ahead or back or in both directions.
 +
 +===== 1. Ensure that you have VMWare Tools installed in the Windows Guest =====
 +
 +If you don't have VMWare Tools running, all bets are off.
 +
 +===== 2. Disable Windows Time Service =====
 +
 +I tried was disabling the service called <wrap nav>​Windows Time</​wrap>​ found <wrap nav>​Control Panel -> Administrative Tools -> Services</​wrap>​. I don't remember where I picked up this hint [citation needed]. So far this change has failed to fix my problem on its own.
 +
 +===== 3. Tell VMWare Server your Host's maximum CPU frequency =====
 +
 +References:​\\
 +http://​blog.autoedification.com/​2006/​11/​vmware-guest-clock-runs-fast.html\\
 +http://​kb.vmware.com/​selfservice/​microsites/​search.do?​language=en_US&​cmd=displayKC&​externalId=1591
 +
 +View <wrap file>/​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​cpuinfo_max_freq</​wrap>​ on the host. You will find a single line giving the maximum speed in kilohertz. Call that <wrap sym>​MAXKHZ</​wrap>​. Now add these lines to <wrap file>/​etc/​vmware/​config</​wrap>​ on the host, substituting your actual value for <wrap sym>​MAXKHZ</​wrap>:​
 +
 +<​code>​
 +host.cpukHz = MAXKHZ
 +host.noTSC = TRUE
 +ptsc.noTSC = TRUE
 +</​code>​
 +Then shutdown any virtual machines and restart VMWare Server with this command:
 +
 +<​code>​
 +sudo /​etc/​init.d/​vmware restart
 +</​code>​
 +
 +----
 +
 +I presume that step 2, and of course step 1, are required for step 3 have the correct effect. As of 28 December, have implemented step 3 right now, and I'll see how it works after a few days.