电竞比分网-中国电竞赛事及体育赛事平台

分享

HELP: VMware - Fixing Time Keeping Problems with the Guest OS

 cwhbox 2012-09-02

Because virtual machines work by time-sharing host physical hardware, a virtual machine cannot exactly duplicate the timing behavior of a physical machine. VMware virtual machines use several techniques to minimize and conceal differences in timing behavior, but the differences can still sometimes cause timekeeping inaccuracies and other problems in guest software.

This problem occurs because current VMware for Linux products do not have complete support for host power management features (such as Intel SpeedStep, or AMD PowerNow or Cool'n'Quiet) that vary the processor speed. To work around this problem, specify the correct maximum CPU speed in your global configuration file.  This can be done on either a Windows host server or a Linux host server.

On a Windows host server:

  1. Find the speed of your host's CPU. For example, in Windows XP, right click My Computer, then chooseProperties. This path may be different, depending on the version of Windows you use.

  2. Look for config.ini in one of the following locations:

    • C:\Documents and Settings\All Users\Application Data\VMware\VMware Workstation\config.ini

    • C:\Documents and Settings\All Users\Application Data\VMware\VMware GSX Server\config.ini

    • C:\Documents and Settings\All Users\Application Data\VMware\VMware Server\config.ini

    • C:\ProgramData\VMware\VMware Workstation or
      C:\Program Files\VMware\VMware Workstation
      (on a Windows Vista host running Workstation 6.0)

     
  3. Edit config.ini, adding the lines described below.

    host.cpukHz = "X" where "X" equals the maximum speed in KHz of your host machine.  That is, its speed in MHz times 1000 or its speed in GHz times 1000000.  A 3GHz machine would be 3000000.
    host.noTSC = "TRUE"
    ptsc.noTSC = "TRUE"

    The second and third lines enable a mechanism that tries to keep the guest clock accurate even when the time stamp counter (TSC) is slow.

    Note: On Windows, you can use Notepad, but be careful when you save the file that Notepad does not add an extra .txt extension to the filename. You can do that by selecting All files instead of Text files in the Save dialog box.

  4. In addition, check the VMware Tools control panel in the guest operating system. On the Options tab, ensure that Time synchronization between the virtual machine and the host operating system is selected.

On a Linux host server:

To prevent guest clocks from running too quickly, specify the correct maximum host CPU speed in your global configuration file, /etc/vmware/config. If this file exists, edit it with a text editor, adding the lines described below. The file may not exist. If it does not exist, create it as a plain text file.

Add the following lines to your global configuration file:

  host.cpukHz = "X" where "X" equals the maximum speed in KHz of your host machine.  That is, its speed in MHz times 1000 or its speed in GHz times 1000000.  A 3GHz machine would be 3000000.
  host.noTSC = TRUE
  ptsc.noTSC = TRUE

To periodically correct the time (once per minute) when a guest clock runs slowly, VMware Tools must be installed in the guest. On the Options tab of VMware Tools in the guest, verify that Time synchronization between the virtual machine and the host operating system is selected.

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多