Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Which performs better under heavy CPU and memory usage on the virtual servers, Xen or VirtualBox?

share|improve this question
add comment

3 Answers 3

up vote 20 down vote accepted

Xen will generally perform much better than VirtualBox because VirtualBox runs the guest OS in a way that the guest OS does not know it is running in a virtual environment. Or to put it another way, the guest OS is not modified to run virtually. Because of this, VirtualBox has to 'trap' kernel type instructions, run some custom code and then return control to the guest. It can use the hardware virtualisation support provided by Intel and AMD, but even then the overhead adds up.

Xen meanwhile makes sure the guest OS is recompiled to fit in with the Xen model. So control flows smoothly from the guest OS to the hypervisor, without the overhead of having to pretend the guest OS has direct access to the hardware.

For an overview of quite a few virtualisation technologies, including data from performance tests, read this report. It only talks about Linux, but it covers Linux-Vserver, Xen, OpenVZ, KVM, VirtualBox and QEMU. Linux-Vserver and Xen were generally the best performers, but read the report to see the different workloads.

Having said all the above, there may be some areas where VirtualBox outperforms Xen. If your guest OS has a graphical windowing layer, then VirtualBox has good support for that, particularly if you install some special VirtualBox components in the guest OS.

And finally you should be aware that Xen will only run a modified guest OS. It cannot run an unmodified guest OS.

share|improve this answer
2  
Do note that virtual machines on xen running windows can only use one core! –  Thomaschaaf May 4 '09 at 19:25
add comment

Since I don't have 50 reputation points I can't comment on Hamish Downer's answer but he is mistaken on his last point. Xen can run unmodified guests however they have to be run as HVM guests which are fully virtualized. Doing this requires that the host computer has hardware virtualization support with Intel VT or AMD-V capable cpu's.

Xen and Virtualbox each have a place but they are two different type of hypervisors. Xen is a Type 1 hypervisor where Virtualbox is a Type 2 hypervisor. Type 1 hypervisors tend to be what you find in server environments where Type 2 hypervisors tend to be more common for running multiple OS's that you interact with as desktops. I think this is mainly due to their simplicity and better desktop integration. However guests under a type 2 hypervisor are further from the underlying hardware and tend to be slower than guests under a type 1 hypervisor. As with everything there's always going to be an exception to the rule.

share|improve this answer
2  
You are perfectly right :-) So you get +1 –  Antoine Benkemoun May 29 '09 at 21:18
add comment

I can only speak about Xen, as I've only ever used Virtualbox for virtualizing a windows machine on my mac desktop.

As others have mentioned, Xen (and XenServer, which is based on Xen) uses paravirtualized kernels that dramatically improves Cpu- and Memory-bound performance characteristics. However, this is only true for Linux hosts with specialized kernels. You need a Xen-"enabled" kernel to be able to take advantage of this.

Also - Windows does not support being virtualized in this manner, but the Intel VT and AMD-V extensions on their respective CPUs "catch" Windows and makes it behave in a paravirtualized manner. Windows 2003 and Windows 2000 is never aware that they are running virtualized, while Windows 2008, on the other hand, detectes this and runs in so-called "enlightened" mode, which can be compared to the Linux "paravirtualized" mode.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.