Page 1 of 1

Allocate As much CPU time inside Guest OS

Posted: 1. Aug 2009, 07:08
by john.doe
I am running Windows XP both on Host and Guest OS on VirtualBox 3.0.2

I found that VirtualBox "Limits" the Guest CPU time to only 50% of Host CPU time.
Put it simply, When Guest OS already use 100% CPU usage (bottleneck), the Host OS only use 50% max

How to allocate as much as CPU time towards the Guest OS?

The number of processoru on the VirtualBox Settings is dimmed, so I cannot select more than 1 processor.
Also, increasing VirtualBox.exe process priority to "High" on Host OS's Task manager doesn't help,
And the Host OS is Idle.

Re: Allocate As much CPU time inside Guest OS

Posted: 1. Aug 2009, 07:13
by john.doe
By the way, I also try running VMware just to try out, and I found I can utilize all host's CPU time towards Guest VM.
So when Guest OS is on 100% CPU usage, the Host is also shows 100%.

Re: Allocate As much CPU time inside Guest OS

Posted: 1. Aug 2009, 08:19
by SecretCode
Most likely you have a dual core CPU? And you have only allocated one CPU in the guest? Go to settings > system > processor ...

Re: Allocate As much CPU time inside Guest OS

Posted: 3. Aug 2009, 07:14
by john.doe
I only have single core processor, and the settings > system > processor is dimmed to 1 cpu only (I cannot change it)
Can anyone please help, otherwise I'm wasting 50% of my CPU time idling

Re: Allocate As much CPU time inside Guest OS

Posted: 3. Aug 2009, 16:13
by baf
Do you have vt-x on?
From the manual:
(SMP, added with version 3.0) both require hardware virtualization to be enabled.

Re: Allocate As much CPU time inside Guest OS

Posted: 4. Aug 2009, 02:54
by john.doe
My processor is single core and does not support hardware virtualization (vt-x).

But it still doesn't make sense, since VMWare can utilize the host's maximum cpu time to the guest OS, even I am on single processor setting.

Re: Allocate As much CPU time inside Guest OS

Posted: 4. Aug 2009, 03:25
by Perryg
Does you bios and/or you host support hyper-threading?
You really should edit you profile and add you host and guest information as well as the type of VirtualBox you are using.

Re: Allocate As much CPU time inside Guest OS

Posted: 16. Aug 2009, 14:48
by fyi
I am noticing this problem too. Happens with 1 CPU assigned in the vbox settings, even with 2 cpus assigned.
The host is scheduling the vbox process as usual, but seems that the guest is limited to half of the cpu resources available on the host.
Yes, my primary has hyperthreading enabled.

Has anybody found a solution to this yet?

Re: Allocate As much CPU time inside Guest OS

Posted: 18. Aug 2009, 02:30
by ezjd
I don't think there should be a solution because if guest can easily eat up 100% CPU of Host, it can also easily freeze host. I observed that assigning 2 CPUs to VM in dual core system, it is possible to use both core 100% and I saw host slows down because of that. Because of that, if you use 2 CPUs in VM might result in 100% CPU load, but don't do that. VM will be less useful if host doesn't run smoothly.

It should related to how VBox works with both host/guest scheduler (maybe only way to figure out is reading the code, thanks to opensource VBox :D). My vmware server experience is similar with VBox: no more than 50% or 100% of one core in dual core system. But I don't play with VMware a lot now :)

Did you try to run 2 VMs at the same time? I think they can both use up to 50% while host can still be very responsive.

Re: Allocate As much CPU time inside Guest OS

Posted: 20. Aug 2009, 19:38
by fyi
A host process on a high spec system only needs a 1 - 5 % scheduling to remain usable if their primary role is just running vm guest processes. :roll: If you are implying an imposed limitation of 50% per 'virtualbox guest process' i would be shocked to say the least. If what you are implying is true - why wouldn't there be an advanced cpu limit setting so people have the choice of what limits they see fit for their system? .. no system is the same, so a fixed implicit limit would seem irrational. I have a feeling this is just a scheduling bug.

Re: Allocate As much CPU time inside Guest OS

Posted: 20. Aug 2009, 22:09
by ezjd
fyi wrote:A host process on a high spec system only needs a 1 - 5 % scheduling to remain usable if their primary role is just running vm guest processes. :roll: If you are implying an imposed limitation of 50% per 'virtualbox guest process' i would be shocked to say the least. If what you are implying is true - why wouldn't there be an advanced cpu limit setting so people have the choice of what limits they see fit for their system? .. no system is the same, so a fixed implicit limit would seem irrational. I have a feeling this is just a scheduling bug.
That is what I don't quite understand. As I am too lazy to read to the code, I asked some questions in http://forum.virtualbox.org/viewtopic.php?f=1&t=21370

Re: Allocate As much CPU time inside Guest OS

Posted: 23. Aug 2009, 01:30
by Kitsune
fyi wrote:Yes, my primary has hyperthreading enabled.
Your issue is the hyperthreading. Hyperthreading makes the Operating System believe that your system has two processors instead of one (basically, each core appears as two logical ones).

You can either enable SMP in the guest, or disable HT to make VB use "100%" of the CPU time (disabling HT in the bios will likely be the solution that'll get you the highest performance in VB).

Re: Allocate As much CPU time inside Guest OS

Posted: 23. Aug 2009, 22:47
by fyi
Hi Kitsune, thanks for the suggestions. My BIOS has no toggle for hyperthreading... so i disabled HT by tacking noht in the boot parameters. No dice with or without SMP in the guest. No dice with or without HT.