Allocate As much CPU time inside Guest OS

This is for discussing general topics about how to use VirtualBox.
Post Reply
john.doe
Posts: 76
Joined: 10. Feb 2009, 16:39
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, Vista, 2003, 2008, various Linux distros and others

Allocate As much CPU time inside Guest OS

Post 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.
john.doe
Posts: 76
Joined: 10. Feb 2009, 16:39
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, Vista, 2003, 2008, various Linux distros and others

Re: Allocate As much CPU time inside Guest OS

Post 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%.
SecretCode
Posts: 67
Joined: 17. Jul 2009, 10:20
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu, XP, other
Location: Finland

Re: Allocate As much CPU time inside Guest OS

Post 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 ...
john.doe
Posts: 76
Joined: 10. Feb 2009, 16:39
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, Vista, 2003, 2008, various Linux distros and others

Re: Allocate As much CPU time inside Guest OS

Post 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
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Re: Allocate As much CPU time inside Guest OS

Post by baf »

Do you have vt-x on?
From the manual:
(SMP, added with version 3.0) both require hardware virtualization to be enabled.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
john.doe
Posts: 76
Joined: 10. Feb 2009, 16:39
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, Vista, 2003, 2008, various Linux distros and others

Re: Allocate As much CPU time inside Guest OS

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Allocate As much CPU time inside Guest OS

Post 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.
fyi
Posts: 25
Joined: 20. Jan 2009, 07:58
Primary OS: Debian Lenny
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP sp3, Debian, others

Re: Allocate As much CPU time inside Guest OS

Post 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?
Sony Vaio SZ79SN/C, 2.6.31.12-rt21, VTx. Core2Duo T9300 2 x 2.50GHz, 800MHz FSB, 6MB L2, GM965, NVIDIA 8400M GS / X3100, 4GB DDR2 667, Seagate GForce, 13.3 WXGA TFT White LED, Intel 4965AGN, 1.76kg
ezjd
Posts: 21
Joined: 15. Aug 2009, 00:31
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: windows

Re: Allocate As much CPU time inside Guest OS

Post 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.
fyi
Posts: 25
Joined: 20. Jan 2009, 07:58
Primary OS: Debian Lenny
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP sp3, Debian, others

Re: Allocate As much CPU time inside Guest OS

Post 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.
Sony Vaio SZ79SN/C, 2.6.31.12-rt21, VTx. Core2Duo T9300 2 x 2.50GHz, 800MHz FSB, 6MB L2, GM965, NVIDIA 8400M GS / X3100, 4GB DDR2 667, Seagate GForce, 13.3 WXGA TFT White LED, Intel 4965AGN, 1.76kg
ezjd
Posts: 21
Joined: 15. Aug 2009, 00:31
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: windows

Re: Allocate As much CPU time inside Guest OS

Post 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
Kitsune
Posts: 11
Joined: 22. Jan 2008, 03:48

Re: Allocate As much CPU time inside Guest OS

Post 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).
fyi
Posts: 25
Joined: 20. Jan 2009, 07:58
Primary OS: Debian Lenny
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP sp3, Debian, others

Re: Allocate As much CPU time inside Guest OS

Post 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.
Sony Vaio SZ79SN/C, 2.6.31.12-rt21, VTx. Core2Duo T9300 2 x 2.50GHz, 800MHz FSB, 6MB L2, GM965, NVIDIA 8400M GS / X3100, 4GB DDR2 667, Seagate GForce, 13.3 WXGA TFT White LED, Intel 4965AGN, 1.76kg
Post Reply