VMware

This Question is Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
12 Replies Last post: Apr 1, 2006 4:23 PM by ScottReese  

Slow Performance on Linux Host. (Laptop) posted: Nov 22, 2005 3:16 AM

Click to view garethy's profile Lurker 5 posts since
Nov 21, 2005
Hi,

I've installed 5.5 Rc2 on my Dell Latitude D810 (2Gb Ram) running Suse 10 as the host and when trying to install Windows 2000 with Sp4 as a guest OS it's incredably slow. The first time you notice it's slow is when after booting the CD windows pops up saying 'Windows is starting setup' I know this normally takes a while until it goes to the next screen but it's a longer pause than normal. Copying the files across it needs for the setup is fine but when the setup is running it takes ages and seem to hang in places. When the prompt comes up saying Windows will restart you computer in 15 seconds this does not cound down in seconds sometimes it misses secons and other times it will be stuck on say 14 seconds for 5 seconds. I just left it on the reboot screen went away for 5 minutes and just as I got back it reboot the workstation after the 15 seconds.

Installing into 4Gb partition tryed from ISO and from CD, also tryed installing vmware from RPM and tgz files. The performace options of the laptop are set to full so the CPU is not throttled.

How can I find out what's causing this slow down ??

Thanks,

Gareth.

Message was edited by:
garethy

Added Laptop to topic subject.

Re: Slow Performance on Linux Host.

1. Nov 21, 2005 6:08 PM in response to: garethy
Click to view dfranz's profile Lurker 8 posts since
Nov 10, 2003
I have an Inspiron 6000 running Libranet Gnu/Linux 3.0(based on Debian 3.1) and found that
an install of W2K would take hours or days. Thus I transfered a virtual machine from another
laptop (my previous main laptop) and found the booting and shutting down of the W2k Guest
was veeery slow-many minutes long. After many trials and recompiles of the 2.6.14-2 kernel
I found a partial fix by accident. I double clicked on an icon on the w2k desktop to open a
command-prompt window(one click should open it based on my settings but it would take
many seconds to open) and the command-prompt window appeared rapidly, like it should.
I then found that I could single click on an icon and then click on any open space on the
w2k desktop and got the same result. A bit of thinking gave me the idea that there was a problem
in handling interupts. I was using ACPI and I then recompiled to use APM. That solved the
problem with Vmware but now the CPU will run at full speed all the time-maybe not too good
when on battery.

You may find a similar problem in your case. Check what power management option you have
enabled in your Linux kernel. If it is ACPI, switch to APM and see if you solve the slow install
problem.

I hope that in time the problem with ACPI can be solved so that I can have Vmware responsive
and yet have the option to slow the CPU when on battery. I'm not sure that the centrino speed
step CPU fequency scaling works with anything other than ACPI enabled.

Delbert Franz

Re: Slow Performance on Linux Host.

3. Nov 25, 2005 9:13 PM in response to: garethy
Click to view jrj's profile Novice 12 posts since
Nov 25, 2005
Well this is a known problem in vmware for linux see
https://www.vmware.com/community/thread.jspa?messageID=92747&#92747

It appears that they still haven't fixed it for 5.5

A differenent work around for this is to set your scaling govenor to performance and run a niced busyloop while your running vmware. The downside being the fans will be going full blast, but at least when your done with vmware you can kill the busy loop and set your governor back to ondemand.

echo "performance" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat ~/bin/busyloop
while /bin/true ; do i=1; done
nice busyloop

Re: Slow Performance on Linux Host.

5. Dec 5, 2005 4:01 PM in response to: garethy
Click to view gtg's profile Enthusiast 93 posts since
Dec 31, 2004
I have just booted Suse10 with the option acpi=off
and noacpi and vmware is working much faster now.

I've just tried this with SuSE 9.3 & Workstation 5.5. VMware now goes like the rocket it used to be.

The question now is ....

Is this a bug in VMWare 5.5 RC2 ?


Doubt it, as I've had this performance problem in both 5.0 & 5.5 (I was hoping 5.5 might have solved it , but no joy :-( )

A bug in the Suse Kernel (2.6.13-15-default) ?
A misconfuguration in the Kernel ?

I suspect it's one of these. I noticed a performance drop in VMware a while ago, which I suspect was after a kernel patch from SuSE. Certainly, when I first built my machine, VMWare was really fast, then it slowed down (and I started loosing network connections as they timed out)

I'm currently on 2.6.11.4-21-9 kernel (Can't have too many numbers in a version string, can we SuSE ?) Maybe if I get time I'll try a vanilla install of SuSE 9.3 and see if the performance is better to verify.

GTG

Re: Slow Performance on Linux Host.

6. Dec 6, 2005 3:51 PM in response to: gtg
Click to view Jaygee's profile Lurker 1 posts since
Dec 6, 2005
I also have a D810 but am using gentoo with 2.6.14-gentoo-r2 kernel with acpi enabled using cpufreqd and have exactly the same problem.

Disabling acpi or running the script above both work as a workaround.

Re: Slow Performance on Linux Host.

7. Dec 15, 2005 1:02 PM in response to: jrj
Click to view Douglas Mayne's profile Lurker 1 posts since
Dec 15, 2005
I have a Dell D610 with VMWare 5.5 running on a Slackware 10.2 host with a self-compiled 2.6.14.3 kernel. This computer was also slow running vmware until I set a "busyloop" as you suggested. I did not need to change the CPU to performance, though. CPU scaling works fine, too.

I have setup a script which launches vmware with the background process which keeps the Pentium M from going to sleep between instructions. Here is what I use to launch vmware:

#!/bin/bash
nice ~/busyloop &
child_p=$!
vmware
kill -1 $child_p
#end script

Thanks for posting the original information. I might have given up on VMWare on that computer without your tip. This is very important information.

Re: Slow Performance on Linux Host.

8. Jan 2, 2006 12:28 PM in response to: Douglas Mayne
Click to view kl1278's profile Lurker 1 posts since
Jan 2, 2006
The problem seems to be ACPI and the state >C1 (C2, C3, C4) the processor is in. (to see what state your processor is in, take a look at: cat /proc/acpi/processor/CPU0/power) The kernel automatically falls asleep running Vmware :)

To force a certain state, (C1 to have good performance), just do:
echo 1 > /sys/module/processor/parameters/max_cstate
To go back to the sleepy state, do:
echo 8 > /sys/module/processor/parameters/max_cstate
Only root can do this. Or do:
chmod 0+w /sys/module/processor/parameters/max_cstate
to change the user permissions. Be careful with this.

In a script, It could look like this:

#!/bin/bash
echo 1 > /sys/module/processor/parameters/max_cstate
vmware
echo 8 > /sys/module/processor/parameters/max_cstate

If this works for you, this is a better solution than the "busyloop".

Re: Slow Performance on Linux Host.

9. Jan 5, 2006 8:03 AM in response to: kl1278
Click to view jrj's profile Novice 12 posts since
Nov 25, 2005
Thanks setting max_cstate does work for me and that is definately better than using the busy loop.

Re: Slow Performance on Linux Host.

10. Feb 2, 2006 2:39 PM in response to: kl1278
Click to view ptfd9100's profile Novice 7 posts since
Aug 25, 2005
I like this it worked for me. I just created a bash script and placed the lines in teh container, added vmwarearts instead of vmware and called it vmwarestart placed it in /etc/vmware. I then just point teh desktop or menu command to the script. The only problem is that I have to execute teh chmod as root every time I reboot. Is there a way to solve this? I don't want to run vmware as root, but want to run teh script as root? or a way to keep teh chmod settings so teh user can cexecute teh script and get teh cpu setting to stick after a boot?

Mike

Re: Slow Performance on Linux Host.

11. Feb 7, 2006 1:00 PM in response to: kl1278
Click to view exad's profile Lurker 2 posts since
Feb 7, 2006
Setting the cstate in a script is dependent on sysfs, and evidentially that is being depreciated - being moved to the /proc. So to do this on my system I have to add the boot parameter "processor.max_cstate=1" to grub.

This is obviously a poor solution, I'd rather not have to reboot the whole system depending on whether I want ACPI to work right or have VMware guest have a good clock.

Re: Slow Performance on Linux Host. (Laptop)

12. Apr 1, 2006 4:23 PM in response to: garethy
Click to view ScottReese's profile Lurker 1 posts since
Mar 9, 2006
Thanks for the solution to my problem. It looks like some people want to know how to do this without being root. Here is my solution:

First, you need a script to set the max_cstate. You're going to want to put this into the /usr/local/bin directory. You will need to be root to create the script. Create a file named setcstate in the /usr/local/bin directory and type (or cut/paste) the script:

#!/bin/bash
#
# Set the processor's maximum cstate
#
# Verify that the data is not out of range
if [ $1 -gt 8 ];
then
exit 1;
fi

if [ $1 -lt 1 ];
then
exit 1;
fi

# Set the max_cstate
echo $1 > /sys/module/processor/parameters/max_cstate
# END OF SCRIPT

You will want to make sure that the script can be executed, so set the executable flag on the file:
chmod +x /usr/local/bin/setcstate

This script will allow the max cstate to be set anywhere from 1 to 8. Unfortunately, you can only run this script successfully if you are root. To get around this, you want to use a program called sudo, which allows you to run programs as the root user. (Tech note: you can't just run the program setuid - most current distros won't allow you to setuid a script.) The sudo program is controlled by a file named /etc/sudoers. It is not recommended that you edit this file by hand. The package comes with a program called visudo which you can use to edit the file. It will check the file when you are finished to prevent errors. As the name suggests, it typically uses the vi command set, which can be ugly if you don't know how to use it. You need to add the following line to the file:

username ALL = NOPASSWD: /usr/local/bin/setcstate

and you need to put the username that you are going to run vmware as. If you are not familiar with vi commands, here is what you will need:

The arrow keys move around in the file. Move to where you want to add the line.
Press the i key to enter insert mode. You will see the word --INSERT-- at the bottom of the screen.
Enter your sudo line.
Press the ESC key to leave insert mode.
Press the : key to enter command mode. The cursor will move to the bottom of the screen
Press wq and press enter. w stands for write and q stands for quit.

Once you have this line in your sudoers file, the user can run the setcstate script as the root user by running:

sudo setcstate 1

to set the max_cstate to 1 or

sudo setcstate 8

to return the max_cstate to 8.

Now it is just a matter of creating a script to set the cstate, run vmware, then reset the cstate. Here is the script that I have in my home directory named runvmware:

#!/bin/bash
sudo setcstate 1
/usr/bin/vmware
sudo setcstate 8

Make sure to set this script to be executable also:
chmod +x ~/runvmware

The final step is to create an icon (or modify an existing one) to run your vmware script instead of /usr/bin/vmware. Now you can run vmware as your own user for security, but still have enough root access to modify and reset the max_cstate in the kernel.

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities