Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run VirtualBox 3.1 on Ubuntu with a Win XP guest. I have noticed to my surprise that when I pause the VM (its screen grays out) VirtualBox continues using 15-20% of the host's CPU.

Is this normal behavior?

Is there a way to avoid it? (Without saving the state of the VM and exiting VirtualBox.)

Thanks for any insights!

~lara

share|improve this question
up vote 7 down vote accepted

In order to lessen VirtualBox CPU usage at all times, resort to this weird hack.

Create a new virtual machine and do not install an operating system to it. Tell VirtualBox it will run DOS and give it the absolute minimum resources. Do not install an O/S. Run it, let it error out on boot and minimize it.

While running your real O/S in a second VM, you will see your idle Virtualbox CPU utilization drop to 3-5%.

Idea from jed4czar: http://ubuntuforums.org/showthread.php?s=58e862a814e65eb96f8fe8389b615366&t=838073&page=2

EDIT: To answer your questions directly

why does Virtualbox use 15-20% CPU when VM is paused?

It is a bug. It is always using 15-20% more CPU than it needs to, when any one VM is up, unless the hack provided is used.

Is there a way to avoid it?

See hack above.

share|improve this answer
    
nice to know, that vbox allocates possibliy used cpu-sources on startup – Diskilla Apr 16 '10 at 12:06
    
very nice, many thanks! – laramichaels Apr 16 '10 at 19:55
    
ooooh it fixed it for me too! Awesome, thanks. For info, I'm running windows 8.1, VM is centos and was consumming at idle time around 15% cpu. VBox v4.3.12 – Sebas Mar 8 '15 at 23:22
    
Amazing this is still an issue. – kmarsh Mar 9 '15 at 14:17

I tried the hack described above with the DOS VM, but with no success (running Ubuntu 12.04 guests on a MacBook Pro with OS X). I also tried the kernel parameter changes mentioned in the Oracle thread, again no change. No matter what I did, my guests seemed to eat 15-20% CPU each. However, I noticed that the one guest I happened to assign 2 CPUs was not chewing 15-20% - it was behaving as expected.

Sure enough, when I switched the others to 2 CPU's the issue disappeared. From previous experience, I know that switching to 2 CPUs also enables the IO APIC option in the motherboard section so I suspected that was the truly interesting change. That is, this one:

IOAPIC Enabled

Note that you have to have the machine shut down to change this setting, otherwise it is greyed out. Once I had enabled this on the guests and restart, it didn't matter if I had 1 or more CPUs, the 15-20% CPU utilization went away, so I thought I would share my solution here.

share|improve this answer

I had the same issue on a Windows 7 Quad box running Oracle 5 in the VM.

Following Adam's advice i checked the Enabled IO APIC option but to no avail. So, i followed kmarsh's idea, which took probably less than a minute to try, and processor usage went down from 15-20% to 4-5%.

The settings used were, Name: Memory Hack, Type: Other, Version: DOS. Memory Size: 4MB, Hard Drive: Do not add a virtual hard drive. Click [Create]. Starting the VM asks for a start-up disk, i used: Host Drive 'D:', click [Start]. Virtual machine states: "FATAL: Could not read from the boot medium! System halted." At that point, the cpu usage dropped, so i minimized the window. Starting a second VM makes no difference.

share|improve this answer
    
It appears this issue is so complex that no one tweak will fix it. – kmarsh Oct 27 '14 at 15:39

I experienced this VirtualBox issue on a 2-cpu P4 machine with 3gigs ram running CentOS 5.5 host.

I did not experience this issue on an i720 8cpu machine with 8 gigs running 64-bit Win7. I ran 3 VMWare virtual machines plus the VirtualBox, all with 2-gigs memory, and had no CPU issues whatsoever.

This suggests either running on a "smallish" machine or on a Linux host is the problem.

Your solution worked well, thanks.

I note that these earlier posts are a year old, and my VirtualBox is the most recent Version 4.0.4, so Oracle has not fixed this bug yet.

share|improve this answer
1  
I would expect that this performance penalty is associated with the face that newer CPUs have VT-x and similar to allow hardware assisted virtualisation which would mean that the VirtualBox program is not doing the work and therefore lower CPU usage. A P4 would likely not have the VT-x technology and so would have to translate system calls via software and use more CPU as a result. – Mokubai Mar 24 '11 at 22:38
    
This must have been fixed by now. using Ubuntu host and XP guest running VirtualBox v4.3.6 when I pause the guest, CPU usage drops bellow 1% – Seeker Feb 21 '14 at 14:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .