How to keep a VMWare VM's clock in sync?

后端 未结 11 1167
無奈伤痛
無奈伤痛 2020-12-13 02:05

I have noticed that our VMWare VMs often have the incorrect time on them. No matter how many times I reset the time they keep on desyncing.

Has anyone else noticed t

相关标签:
11条回答
  • 2020-12-13 02:42

    In my case we are running VMWare Server 2.02 on Windows Server 2003 R2 Standard. The Host is also Windows Server 2003 R2 Standard. I had the VMware Tools installed and set to sync the time. I did everything imaginable that I found on various internet sites. We still had horrendous drift, although it had shrunk from 15 minutes or more down to the 3 or 4 minute range.

    Finally in the vmware.log I found this entry (resides in the folder as the .vmx file): "Your host system does not guarantee synchronized TSCs across different CPUs, so please set the /usepmtimer option in your Windows Boot.ini file to ensure that timekeeping is reliable. See Microsoft KB http://support.microsoft.com/kb... for details and Microsoft KB http://support.microsoft.com/kb... for additional information."

    Cause: This problem occurs when the computer has the AMD Cool'n'Quiet technology (AMD dual cores) enabled in the BIOS or some Intel multi core processors. Multi core or multiprocessor systems may encounter Time Stamp Counter (TSC) drift when the time between different cores is not synchronized. The operating systems which use TSC as a timekeeping resource may experience the issue. Newer operating systems typically do not use the TSC by default if other timers are available in the system which can be used as a timekeeping source. Other available timers include the PM_Timer and the High Precision Event Timer (HPET). Resolution: To resolve this problem check with the hardware vendor to see if a new driver/firmware update is available to fix the issue.

    Note The driver installation may add the /usepmtimer switch in the Boot.ini file.

    Once this (/usepmtimer switch) was done the clock was dead on time.

    0 讨论(0)
  • 2020-12-13 02:44

    This documentation solved this problem for me.

    0 讨论(0)
  • 2020-12-13 02:45

    according to VMware's knowledge base, the actual solution depends on the Linux distro and release, in RHEL 5.3 I usually edit /etc/grub.conf and append this parameters to the kernel entry: divider=10 clocksource=acpi_pm

    Then enable NTP, disable VMware time synchronization from vmware-toolbox and finally reboot the VM

    A complete table with guidelines for each Linux distro can be found here:

    TIMEKEEPING BEST PRACTICES FOR LINUX GUESTS http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427

    0 讨论(0)
  • 2020-12-13 02:47

    I'll answer for Windows guests. If you have VMware Tools installed, then the taskbar's notification area (near the clock) has an icon for VMware Tools. Double-click that and set your options.

    If you don't have VMware Tools installed, you can still set the clock's option for internet time to sync with some NTP server. If your physical machine serves the NTP protocol to your guest machines then you can get that done with host-only networking. Otherwise you'll have to let your guests sync with a genuine NTP server out on the internet, for example time.windows.com.

    0 讨论(0)
  • 2020-12-13 02:49

    Something to note here. We had the same issue with Windows VM's running on an ESXi host. The time sync was turned on in VMWare Tools on the guest, but the guest clocks were consistently off (by about 30 seconds) from the host clock. The ESXi host was configured to get time updates from an internal time server.

    It turns out we had the Internet Time setting turned on in the Windows VM's (Control Panel > Date and Time > Internet Time tab) so the guest was getting time updates from two places and the internet time was winning. We turned that off and now the guest clocks are good, getting their time exclusively from the ESXi host.

    0 讨论(0)
  • 2020-12-13 02:51

    The CPU speed varies due to power saving. I originally noticed this because VMware gave me a helpful tip on my laptop, but this page mentions the same thing:

    Quote from : VMWare tips and tricks Power saving (SpeedStep, C-states, P-States,...)

    Your power saving settings may interfere significantly with vmware's performance. There are several levels of power saving.

    CPU frequency

    This should not lead to performance degradation, outside of having the obvious lower performance when running the CPU at a lower frequency (either manually of via governors like "ondemand" or "conservative"). The only problem with varying the CPU speed while vmware is running is that the Windows clock will gain of lose time. To prevent this, specify your full CPU speed in kHz in /etc/vmware/config

    host.cpukHz = 2167000

    0 讨论(0)
提交回复
热议问题