VirtualBox High CPU Usage Problem Solved
Blog | Tech Blog | Secure Coding | Twitter | RSS Feed | Get Email Updates
A few days ago, I had to install Windows XP as a guest OS on my Ubuntu Hardy machine as I needed to carry out some Visual Studio work. What I noticed was that my CPU usage went through the roof (constantly at 100%) even if the guest was completely idle. Result: My laptop was shutting down within a few minutes because the CPU was heating up and its temperature going beyond 75C. And finally came to know a simple solution from a friend, that immediately worked. The solution was to create a new dummy guest machine in VirtualBox, allocate minimal RAM to it (I gave 4MB) and just run it, don’t even need to add boot disk to it and to my surprise, the CPU usage came down to just 3-4% immediately. I’m not sure why this issue is happening and how the dummy machine solved it but atleast it is working for me now. If you have a similar issue, you can try out the same.
© Shantanu Goel | VirtualBox High CPU Usage Problem Solved
|
Liked this post? Get FREE Updates Subscribe to RSS feed |






This post has 12 comments
July 9th, 2009
I tried this on Ubuntu 9.04.
my cpu usage still remains around 45% (it was the same before also)
July 11th, 2009
@Himanshu: Your issue might be something else then. For me, it was continuously around 95-100% before this.
August 24th, 2009
Hi shantz.
Strange issue, I ran into some strange trouble with VirtualBox recently too. Like 3 times within 7 days my XP bluescreened and refused to boot afterwards whatsoever. So I had to backup an image I found on some external hd by chance, just to run into the same bluescreen -> unbotable state again.
However, I had to suffer from a 2 low threshold setting (as I thought it was) as well. 85° and my Laptop would power off. Very annoying as such high loads usually only occur during builds.
Finally I stumbled upon linux-phc, a module which enables undervolting.
And actually, reading my cpu’s msr told me that the default vids were too high, namely 1,375V.
Compared to what Intel defines as max, 1,175V, fixing this prevented my PC from temperature caused shutdowns ever since, my temperatures don’t exceed 80° anymore ever since, no matter what.
I’ve been able to set the first 3 steps to the lowest possible voltage (hardcoded), the highest frequency to just one step higher.
So, if you’re suffering from these shutdowns too, you might want to take a look at.
http://www.linux-phc.org
Enjoy
August 26th, 2009
wow, thanks loomsen. That’s an interesting piece of info. It is interesting in two regards. First I didn’t know that laptop manufacturers can have such a major oversight and second that I thought undervolting was only possible through BIOS. I’ll definitely try it out. Thanks once again.
September 12th, 2009
The problem you described here is actually due to a bug in virtual box that has to do with the CPU affinity. In other words virtual box does not like switching between multiple cores.
By starting a second virtual box instance you are basically doing the same thing as just setting the CPU affinity for the process. If you are running virtual box from a GNU/Linux host, you can use taskset to set the CPU affinity.
December 2nd, 2009
Thanks man, I found a lot of posts about the subject but only your fix my problem… Also I’m too lazy and Linux noob to rebuild my kernel. So it’s a quick and dirty fix that works great
December 5th, 2009
Amazing, that fix works!
I tried setting the processor affinity of the virtualbox processes to one CPU, but it doesn’t make a difference. As soon as I started up a “dummy” guest instance… CPU goes to almost 0%
January 8th, 2010
I solved the issue by:
- changing my Windows XP installation to single core (using HALu: http://www.hardware.info/en-US/news/ym2cmZqYwp2a/Problems_updating_to_a_dualcore_CPU_Not_anymore/)
- shutdown Windows XP
- change the number of processors in VirtualBox from 2 to 1
February 17th, 2010
yep, taskset didnt help at all, but a headless 4mb ram guest with no boot disk, in a failed to boot state does. Thanks for the post! This was on centos 5
VirtualBox-3.1-3.1.4_57640_rhel5-1
Linux vms01.internal 2.6.18-164.2.1.el5PAE #1 SMP Wed Sep 30 13:32:13 EDT 2009 i686 i686 i386 GNU/Linux
Intel(R) Xeon(R) CPU E3110 @ 3.00GHz
February 18th, 2010
You’re a great guy !
Solved my 100% cpu problem
seven 64 ultimate host – centos 2.6.18 kernel guest
thanks a lot !
March 1st, 2010
Hey dude! Nice hack!
I can’t say it solved my CPU problem completely like for others here, but it def helped a lot! My CPU usage was about 70% and with the dummy guest its now down to 20% which makes life a bit easier.
Mac OS X 10.6 (Host) – CentOS 5.4 (Guest)
Thanks!
March 9th, 2010
Awesome.. This helped tremendously. I went from ~55 – 90% CPU usage and constant load avg of nearly 1 on a dual-core machine to like max 20% cpu usage by virtualbox and load avg of nearly 0 on the linux host OS.
Amazing. This most likely has to do with a bug in VirtualBox wrt to cpu affinity. I have one cpu enabled out of 2.
Trackbacks