10 Replies Latest reply on Jan 21, 2011 9:43 AM by unitedwallabies

    Guest OS' clock runs too fast

    rubio Lurker

      I have looked for solutions for this problem, but haven't found one that works for this system. Any help or pointers would be greatly appreciated.

       

      The clock of the guest OS runs around 1.5x faster than that of the host OS. The problem is present whether the guest OS is idle or busy.

       

      Among several things, I have disabled power management on the host. I have tried a time server which failed as the time drifted too fast. Also tried VMware tools, but it only corrects time when the guest falls behind, not when it goes ahead in time.

       

      The host is:

      • One Dual-core Intel Xeon 5160 -- 3.00GHz; 12 GB

      • "SUSE Linux Enterprise Server 10 SP1 (x86_64)"

      • VMware-server-1.0.4-56528 (the problem was also there for version 1.0.2)

      • cpufreq governor set to "performance" (so cpu frequency is always at 3 Ghz)

      • No other apps running except for vmware

       

      The guest is:

      • Windows Server 2003 Enterprise

      • 1 processor; 1 GB

      • c:\windows\system32\hal.dll internal name is halaacpi.dll

      • default "boot.ini"

      • Running VMware tools with time synchronization enabled

      • Running a database and other "periodic" daemons/services

       

      Let me know if you have any questions or advice.

        • 1. Re: Guest OS' clock runs too fast
          rubio Lurker

          I also disabled processor power management in the BIOS as recommended here (http://communities.vmware.com/thread/106492?tstart=0). But the problem is still present.

          • 2. Re: Guest OS' clock runs too fast
            rubio Lurker

            BTW, the host is configured for 250 Hz (4ms):

             

            % gunzip -c /proc/config.gz | grep CONFIG_HZ

            CONFIG_HZ_250=y

            CONFIG_HZ=250

            • 3. Re: Guest OS' clock runs too fast
              Jim VandeVegt Lurker

               

              I have the same situation. Both WinXP and Linux guests are running way fast.

               

               

              No published fixes have had any effect. I first noticed the problem when I went to v1.0.3 and 64-bit and a dual-core host.

               

               

              I am running 1.0.2 on 64-bit SLES 9 on a single-core AMD Athlon64 with no problems. WinXP guests stay right on target.

               

               

              • 4. Re: Guest OS' clock runs too fast
                Knobee Enthusiast

                Well, I hate to say it, but this is the "never ending question".  If we could get a good, definitive answer on this one, I'd be overjoyed.

                 

                 

                Anyone?

                 

                 

                 

                I'm running on a Dell 6650 with 3 physical CPUs (6 cores) with Ubuntu 7.04 on the physical hardware (no skew), vmware server 1.0.3(?) and seeing time skew of about 1.5x on guests running FreeBSD 6.2 and other Linux variants

                 

                 

                Help!

                 

                Message was edited by: Knobee to add version information

                • 5. Re: Guest OS' clock runs too fast
                  chanla Lurker

                   

                  I am very annouying with this never ending clock problem...

                   

                   

                  My host is Dell Laptop with 2GHz Core 2 Duo running Windows XP.  I am using VMWare Workstation 6.0.2.

                   

                   

                  My guest is Linux 2.6.23.1 with the latest vmware tools installed and running.

                   

                   

                  I have pretty much tried every trick I can find on how to fix the fast clock problem, but nothing seems to work.  My linux guest is not useable because the clock is running about 2x or 3x real time. 

                   

                   

                  Setting  the host config with:

                   

                  host.cpukHz = "2000000"
                  host.noTSC = "TRUE"
                  ptsc.noTSC = "TRUE"

                   

                  didn't seem to help.  I also need to add the kernel option noapic to linux with that config.

                   

                   

                  I have tried two different clock settings for linux: clock=pit notsc and clock=mptmr and no luck with either.

                   

                   

                  I set the kernel config to use 100Hz clock.  Didn't help.

                   

                   

                  Now im just tinkering with different kernal options in the kernel config in hopes that disabling something will make it start working...

                   

                   

                  Anyone else have any luck with this problem?

                   

                   

                  Andrew

                   

                   

                  • 6. Re: Guest OS' clock runs too fast
                    chanla Lurker

                     

                    After playing with the timing issues for a couple hours today I figured out that the guest OS runs perfectly as long as my laptop is on AC power when it boots.  If the AC power goes away and comes back, it doesn't work without a reboot.

                     

                     

                    Andrew

                     

                     

                    • 7. Re: Guest OS' clock runs too fast
                      Steve-J Lurker

                       

                      might want to try this to get the cpu freq

                       

                       

                      cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq

                       

                       

                      use that result for the first line of :

                       

                       

                      host.cpukHz = 1833000

                      host.noTSC = TRUE

                      ptsc.noTSC = TRUE

                       

                       

                      and insert this into the /etc/vmware/config

                       

                       

                      I don't believe you use quotes around the values

                       

                       

                       

                       

                       

                      • 8. Re: Guest OS' clock runs too fast
                        AWo Guru

                        Enable the VMware TimeTracker logging:

                         

                        Add

                          timeTracker.periodicStats="True"

                          timeTracker.statsIntercal="10" (for 10 sec. tracking intervall"

                         

                        to the guests .vmx file (guest needs to be restarted) and post the entries from vmware.log (start with "TimeTrackerStats").

                         

                         

                        General background:

                         

                        The issue with virtualization and (mostly) Linux guests is, that Linux (and other OS's, too) are using the PIT (Programmable Interrupt Timer) to count the timer ticks. Linux requests a timer interrupt in frequencies of 100 - 1000 Hz per OS instance + per (virtual) processor (n+1). One bad thing about that is, that this will consume ressources, even if the system itself is idle.

                         

                        The other bad thing is that only the guest which actually owns the processor receives the interrupt, so many interrupts are lost (Lost Timer Tick). That's why the time of a virtualized machine would always run too slow, if there is no compensation.

                        Windows uses the PIT, too, and other different mechanisms/time sources which can even change if you install software, for example Apple's Quick Time.

                         

                        As loosing these ticks happens on hardware, as well, there is a Lost Timer Tick correction algorithm within Linux to compensate this. This works well enough on pure hardware.

                        But there's a second compensation mechanism if you run it onVMware: VMware tracks the interrupts lost and sends them in a timely compressed manner to the guest later (in fact not all are send, some lost ticks needs to be deleted by the Vmware time management). That's the reason why the time doesn't run consistent and seems to "jump" sometimes.

                         

                        So there are two mechanisms to keep the time accurate and that could lead to a clock running too fast (overcompensation). There is no way to slow it down with the VMware tools, yet, nor do they set the time back. Slowing down the clock is planned for a future release of the tools.

                         

                        The suboptimal usage of the PIT has changed from Kernel 2.6.18 for 32 Bit / 2.6.21 64 Bit. In newer Kernels Linux uses a different lock source (TSC, Time Stamp Counter) where it can read the time directly (has not to count the ticks to generate the time) and without using an interrupts. Another advantage is that his time device can be read faster that the PIT.

                         

                        AWo

                        • 9. Re: Guest OS' clock runs too fast
                          dubek Lurker

                          We had the same problem (guest clock running too fast), and solved it using Steve-J's solution from above.

                           

                          Our setup is as follows:

                           

                          • Host: Dell R200 server, CentOS 5.2, Kernel 2.6.18-92.1.18.el5PAE (SMP)

                          • Guest: 2 processors (this is a definition in the vmx file), CentOS 4.6, Kernel 2.6.9-78.0.8.ELsmp

                           

                          We just followed Steve-J's steps; on the host:

                           

                          # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
                          2133000
                          

                           

                          And then use that number when adding these lines to the end of /etc/vmware/config :

                           

                          host.cpukHz = 2133000
                          host.noTSC = "TRUE"
                          ptsc.noTSC = "TRUE"
                          

                           

                          Then restart the vmware server:

                           

                          service vmware restart
                          

                           

                          • 10. Re: Guest OS' clock runs too fast
                            unitedwallabies Lurker

                            My FreeBSD-8.2 VM suddenly began exhibiting the same behaviour two days ago... In fact, I left work an hour early, because I looked at the KDE's clock inside the VM, instead of consulting that of the MacOS host...

                             

                            For me the solution proposed on a FreeBSD forum helped:

                            sysctl kern.timecounter.hardware=TSC

                            I did this from command line and the clock began running normally. I then placed it into /etc/sysctl.conf, so that the setting survives reboots. I'm sure, Linux has a similar setting...