VirtualBox – my current favourite desktop virtualisation software – has been released in version 3.0.0 two days ago, so I gave it a try. The most interesting new feature in this new version is the “Guest SMP” support. It finally removes the limitation, that a guest can only work on one host core (which means, when you have a 4-core host CPU, the guest could only run with 1/4 of the speed).
The documentation is not very clear about what “Guest SMP” really does – it could, for example, just show multiple CPUs to the guest, but still only use one host core. To make sure that my assumption of VirtualBox 3 actually making it possible to assign multiple host CPUs/cores to the guest, so that it can actually run faster, I did a quick test. I started by making one of my Linux VMs a dual CPU VM:
In the VM, I then started to build the Linux kernel, once with make -j1
and once with make -j2
. This is my CPU usage monitor on the (2-core) host, which shows both cores’ usage combined:
In section 1 of the graph, only one compiler process is running (make -j1
). At the end of section 1 I aborted the building process and (in section 2) I typed in make -j2
. Thus, section 3 shows the CPU usage when two compiler processes are running simultaneously in the VM. So my assumption was correct, it is now possible to make all of the host’s processing power available in a VM.
Thanks, VirtualBox team! (I won’t address the company behind VirtualBox, since this would probably cause my post to be outdated before I can press the “Publish” button). Lets just hope that this great project will see further development, it is currently the best desktop virtualisation project available, in my opinion. It would be even greater if all of the functionality was available in the Open Source version though. This would ensure that, no matter what the current company behind VirtualBox decides to do with it, development could go on.
Hi Patrick,
You’ll soon notice that I’m new in Ubuntu (Linux) so… I can’t take advantage of that “make -j2” you’ve mentioned before.
Can you explain it a little bit better, plis?
The fact is that I need the VM running in more than one thread (thus using more than one CPU). Ah, let me clarify: my Core 2 Quad can’t handle VM-x.
Any help on any of this?
(sorry for my spanglish)
Hi Yopyhi,
well, “make -j2” just starts two compiler processes in parallel, which means there are two processes running that both want to use 100% of one CPU (or core). You could just as well encode two videos at the same time, for example.
I think by “VM-x” you mean “VT-x” – most Core 2 Quad CPUs support it (see here). The mainboard also needs to support it… So if you really don’t have hardware that supports VT-x (or AMD-V), you’re out of luck.