1

I am running Ubuntu 14.10 64 bit under Windows 8.1 64 bit using VirtualBox 4.3.10. I have an Intel Core i5-2410M CPU, with 2 physical cores and enabled HyperThreading and virtualization.

I have set everything mentioned in this other post:

  • System version set to Ubuntu 64 bit
  • I/O APIC is enabled
  • CPU number of the VM is set to 2 (maximum allowed)
  • VT-x/AMD-V enabled
  • Execution Cap is 100%

When I run a CPU-intensive task in the Ubuntu, it uses CPU on 100% according to the Ubuntu task manager, but under Windows it's only ~70%.

Ubuntu (guest):

Ubuntu CPU usage

Windows (host):

Windows CPU usage

It's not the maximum, if I run CPU intensive tasks on Windows, it reaches 100%:

enter image description here

Ubuntu only sees 2 CPUs with 1 thread per core (running lscpu):

lscpu output

How can I make the virtual ubuntu use all of my CPU power?

2
  • Most systems reserve CPU for their own tasks, unless you are running on the bare metal you would not reach 100% utilisation on the host machine. Commented Dec 20, 2014 at 22:19
  • OK, but I can do other heavy tasks on the host system while my guest uses the CPU on 100%, which increase the CPU usage on the host system, but doesn't decrease on the guest system. So it seems there are still power in my CPU which I can't use on the guest system.
    – hunyadym
    Commented Dec 20, 2014 at 22:32

2 Answers 2

1

There a few things that make things appear as they are. Correct me if I got something wrong:

  • HyperThreading appears as two additional cores on your dual-core CPU but will not act as real cores. HT will give you a maximum of 30% performance gain and 10% in real world applications. Full load on your Windows host will never show 100% load on each logical CPU in task manager. Task manager may also hide kernel-space load and only present user-space load.
  • You have presented two logical CPU:s to your VM, which will amount up to 50% total system load on the Windows host.
  • Assuming that 100% load on the guest equals 100% load on each presented logical CPU, you will cause 50% total load on the Windows host and with other things also running, apparently 68% in grand total.

I've been fiddling with virtualization, Windows and Linux for some time (even professionally) and HyperThreading is always causing questions like this. The issue is that new logical cores appear that do not appear to have the same power as proper cores (poor explanation)... Another example is the opposite where the message is that the new CPU:s were so much faster that total system load is only about 50% while the load really is 100%.

4
  • 1.) Yes, I understand what HT is. But actually, task manager shows all 4 (virtual) cores at 100% if I do something CPU intensive on host side while the virtual machine running at full power: i.imgur.com/dWDfePg.png This means that the guest doesn't use full power of the CPU (because I can do other things host-side while guest is on 100% which increases CPU load).
    – hunyadym
    Commented Dec 23, 2014 at 0:40
  • 2.) Yes, I know that the guest Linux sees 2 cores with only one thread on each (as the lscpu in the question states) - so no hyperthreading. But I can't set CPU number to 4: i.imgur.com/RymrM7V.png, and as the documentation (virtualbox.org/manual/ch03.html#settings-processor) says: "You should not configure virtual machines to use more CPU cores than you have available physically (real cores, no hyperthreads)."
    – hunyadym
    Commented Dec 23, 2014 at 0:50
  • But the question still holds: can I (and if yes, how) reach that the guest OS can use all of my CPU power?
    – hunyadym
    Commented Dec 23, 2014 at 0:52
  • @hunyadym to make the VM get all available CPU power, turn it off and set the CPU amount to four.
    – mingalsuo
    Commented Dec 23, 2014 at 10:42
0

VirtualBox should have a setting under the Ubuntu "machine" settings, somewhere there are CPU settings where you can change the maximum CPU usage % allowed (and number of cores & some features too). It's probably set to 70% max, change it to higher if desired.

Also, your real CPU may be one of the "funny" intel ones that only has 2 real cores, but "pretends" to have 4 "fake" cores via hyperthreading. Does your windows CPU usage ever reach 100% on all cores? An old hyperthreading CPU I used to have would only ever max out at 100% on one "fake" core, since there was only one real CPU core it could never reach 100% on 2 "fake" cores. But maybe hypterthreading & windows has changed since then....

[Usually hear "Why is my CPU maxed out?" this is a different direction ;-]

2
  • I think it's the Execution Cap setting you mentioned, but (as I mentioned in the question) it's already set to 100% (my settings: i.imgur.com/RymrM7V.png; sorry, it's in Hungarian, similar English screen here: i.sstatic.net/UkRK5.jpg). And yes, from Windows I can use the CPU on 100%: i.imgur.com/dWDfePg.png
    – hunyadym
    Commented Dec 20, 2014 at 21:53
  • That looks like the setting there. Hmmm... could be other settings that might affect it, the pae/nx isn't checked in the Hungarian photo, but changing that might not let Ubuntu boot (could change back, or "revert to snapshot"). Not sure why else, maybe just can't use more CPU with that windows & Ubuntu virtualbox...?
    – Xen2050
    Commented Dec 20, 2014 at 22:26

You must log in to answer this question.

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