
Search the Knowledge Base: |
Search the Knowledge Base: |
This problem can occur on a Linux host running 2.4 kernel when the virtual machine is running software that requires a high-speed timer, such as the Windows multimedia timer. The problem doesn't normally occur if the host is running a 2.6 kernel, because these kernels have a faster timer interrupt rate by default.
When the virtual machine requires a high-speed timer, the requirement is usually met by /dev/rtc on the host. In some circumstances, /dev/rtc is unavailable, leading to slowness in the guest.
The main symptom is that the virtual machine's clock fails to keep time properly. In addition, applications that are timed by the virtual machine's clock, such as Windows menu animations, may also run slowly. Applications that don't use the timer to delay their execution run at normal speed.
Note: Before deciding whether to attempt the workaround described below, be sure to read the "Background" section at the end of this article. It contains a more detailed description of the symptoms to help you decide whether the workaround applies to the problem you are seeing.
The workaround has two parts: building a custom kernel for your Linux host so it uses a higher timer interrupt rate, and adding a special setting to the virtual machine's configuration file.
See the documentation for your Linux distribution for detailed instructions on how to build and run a custom kernel. There is one key change you must make before building the custom kernel.
Locate the following line in /usr/src/linux-2.4/include/asm-i386/param.h:
#define HZ 100
Change the value of HZ to 1000:
#define HZ 1000
Note: For certain Red Hat Linux 7 and 8 kernels — including 2.4.18-18.7.x and some later versions — the procedure for increasing the timer interrupt rate is different. Do not edit the value of HZ in /usr/src/linux-2.4/include/asm-i386/param.h. Instead, configure a new kernel in the normal way (use either make config or make xconfig) and change the value of CONFIG_HZ to 1024. If you use make xconfig, you can find the option in the General setup menu. Then proceed to compile the kernel according to the Red Hat instructions.
Note: The driver in /usr/src/linux-2.4/drivers/net/sk98lin (the driver for the GEnesis PCI Gigabit Ethernet Adapter) does not compile with HZ set to anything other than 100. Unless you need this driver, simply omit it when configuring the kernel. If you do need this driver, see the section "Patch for sk98lin" below.
Open the configuration (.vmx or .cfg) file for the virtual machine in a text editor and add the following line:
host.useFastclock = FALSE
Reboot the host using your custom kernel and launch the virtual machine; it should run the application that requires a high-speed timer without causing the virtual machine to run slowly.
If you need to use the driver in /usr/src/linux-2.4/drivers/net/sk98lin, you can try the following patch for sk98lin. Note that this patch is untested.
--- ../linux-2.4.18-10/drivers/net/sk98lin/h/skgepnm2.h Wed Jul 4 11:50:39 2001+++ ./drivers/net/sk98lin/h/skgepnm2.h Wed Oct 2 18:44:17 2002 @@ -341,7 +341,12 @@ #if SK_TICKS_PER_SEC == 100 #define SK_PNMI_HUNDREDS_SEC(t) (t) #else +/* x86 kernel runtime doesn't support 64-bit multiplication/division */ +#define SK_PNMI_HUNDREDS_SEC(t) + (((unsigned long)(t)) / ((unsigned long)SK_TICKS_PER_SEC/100)) +/*** #define SK_PNMI_HUNDREDS_SEC(t) (((t) * 100) / (SK_TICKS_PER_SEC)) +***/ #endif
The problem occurs when guest operating systems or applications running in the virtual machine request a virtual timer interrupt rate that is higher than the real timer interrupt rate the host operating system is using.
When the virtual machine requires a high-speed timer, the requirement is usually met by /dev/rtc on the host. In some circumstances, /dev/rtc is unavailable, leading to slowness in the guest.
In older VMware products (prior to VMware Workstation 4.5 and GSX Server 3), the problem occurs whenever you run more than one virtual machine that requires a high-speed timer. In these products, check the Devices menu to see whether /dev/rtc is available and connected. If only one virtual machine has /dev/rtc connected, it runs properly. If more than one virtual machine needs /dev/rtc at the same time, you may see this problem.
You may also see the problem, even in current products, if a non-VMware application on the host is using /dev/rtc or if your host Linux kernel does not have full support for /dev/rtc. In particular, you are likely to see the problem if your host is a 64-bit system running Red Hat Enterprise Linux 3. The 64-bit version of this distribution uses a Linux 2.4 kernel whose /dev/rtc driver cannot generate interrupts, and it runs its main system timer at 100Hz.
Most Linux kernels 2.4 and earlier also use 100Hz, but have full support for /dev/rtc.
Note: If you are running a 2.6 kernel on your Linux host, this article does not apply. The default timer interrupt rate for a 2.6 kernel is already 1000Hz, so /dev/rtc is usually not needed.
The problem commonly occurs with the following software in the virtual machine:
You should set the host HZ value to the fastest guest value. The recommended value of 1000 should cover all these cases.
There are some drawbacks to increasing the value for HZ. In particular, running top on the host gives misleading results, because top assumes HZ is always 100.