VirtualBox vs. KVM on the Desktop: A Comparison

As we wrote recently, KVM has a lot to recommend it as a virtualization solution in Ubuntu 10.04, especially in the server room.  But how ready is it for the desktop, and can it contend with applications like VirtualBox when it comes to ease-of-use?  Read on for a comparison of two of the Ubuntu world’s most popular virtualization products, and some thoughts on which one is better for desktop users.

If you haven’t yet tried KVM, you should, whether you’re using Ubuntu on a server or a desktop.  As Linux’s built-in virtualization hypervisor, KVM can run a wide variety of guest operating systems with impressive efficiency.  On some platforms, it can also take advantage of paravirtualization to make things even faster.

VirtualBox, meanwhile, has long been established as a popular and free (thought not entirely Free) virtualization platform, especially for desktop users.  And the project, which was originally owned by Innotek, then acquired by Sun and consequently now owned by Oracle, continues to push out innovative features.

While KVM and VirtualBox are both excellent products, I wanted to determine which of them was better suited for the desktop.  Here’s what I found.

Management Tools

For desktop users–especially the non-geeky ones–simple and intuitive management tools are essential for running virtual machines.  To this end, VirtualBox comes with a pretty well designed GUI for creating and running guest machines.  If you can point and click, you can use VirtualBox.

VirtualBox screenshot

KVM, in contrast, doesn’t have any official management interface.  A variety of third-party tools, however, are capable of managing KVM domains.  The most popular of these is RedHat’s virt-manager, which offers a simple but efficient graphical interface.

Virt-Manager screenshot

I like virt-manager, especially because it can manage both local virtual machines and those running elsewhere on the Internet (although that’s not a very relevant feature for most desktop users).

On the other hand, adding virtual hardware to a guest is not as easy as it could be.  In older versions of virt-manager, the terminology could also be confusing; for example, powering down a virtual machine was referred to as “destroying” it, which was a bit ambiguous.

Convirt, from Convirture, is another GUI tool for managing KVM virtual machines.  It’s similar to virt-manager and also supports remote machines as well as local ones.  Unfortunately, I’ve found it pretty buggy on my Lucid desktop, to the point that it was not usable.

Convirt screenshot

When it comes to graphical management applications, then, VirtualBox beats KVM.  If you like the command-line, however, KVM wins hands-down; although VirtualBox does offer a CLI interface, it’s not as comprehensive as KVM’s virsh.  There’s also no way to launch VirtualBox virtual machines directly from bash, as can be done with KVM.

On the other hand, most non-geeks are probably not very interested in CLI management tools.  Ultimately, therefore, VirtualBox really comes out ahead in terms of ease-of-management on the desktop.

Features

More than management utilities, features are paramount for desktop users–and on this front, KVM and VirtualBox both have their strengths and weaknesses.

KVM offers a wide range of advanced virtualization functionality, such as live migration and optional paravirtualization.  VirtualBox also offers some of these features, but it comes up short on the paravirtualization front.  These advanced operations, however, are mostly not the type that are very useful to desktop users.

Both VirtualBox (in its closed-source version) and KVM support passing hardware devices directly to guest operating systems, a feature that can be very useful in a variety of circumstances.  KVM can handle PCI passthrough as well as direct access to the USB bus, however, a feature that remains unimplemented in VirtualBox.  As a plus, this functionality can now be easily configured in recent versions of virt-manager.  But again, functionality like this is beyond the scope of what most desktop users are interested in.

One feature that is important to many desktop users, in contrast, is video acceleration in guest operating systems.  This is a central prerequisite for Ubuntu users who dream of playing Windows games without having to dual-boot.  As we wrote last winter, VirtualBox in principle offers such support, although in practice it doesn’t always work well.  KVM currently lacks 3D-acceleration support, however, so VirtualBox still comes out ahead on this front.

Similarly, VirtualBox’s “Guest Additions” feature makes it easy to integrate guest machines into their host environment by sharing the mouse and even the clipboard.  Although some drivers can be installed in certain types of KVM guests to improve performance, none of KVM’s management tools makes integration with the host so seamless.

In absolute terms, it’s hard to choose between KVM and VirtualBox when it comes to the features offered.  With respect to the functionality that desktop users are likely to want, and the ease with which it can be accessed, however, VirtualBox comes out on top.

Conclusion

So which virtualization solution is best for the Ubuntu desktop?  For the time being–and this is to say nothing of the various options which I’ve not discussed, such as VMware’s products and Xen–VirtualBox is probably the better choice for users who want a simple application for running mainstream operating systems without ever having to touch a configuration file or open a terminal.

For those interested in cutting-edge virtualization functionality, or who actually prefer the command-line, however, KVM has a lot to offer.  At the least, although its developers are clearly focused on the enterprise, it should not be ruled out as a virtualization solution for normal desktop users, especially when it’s combined with GUI management tools.

Our advice: don’t apt-get remove VirtualBox from your Ubuntu desktop yet, but keep your eye on KVM as it continues to develop.

10 Comments on “VirtualBox vs. KVM on the Desktop: A Comparison”

  1. dan_linder Says:

    I have used VMWare Workstation/Player, and VirtualBox on my desktop and have played with many OS’s as guests (Windows XP, Win2K3, Win2K8, 32 and 64bit, etc). On these virtualization environments the speed was close to the same speed directly on the same hardware.

    When 10.04 came out, I installed virt-manager and easily created a new virtual machine (single CPU, 768MB RAM, 16GB hdd) and pointed it at my Win2K8-64bit .iso image and went to lunch (after answering the first few questions). I was shocked to see that the %-complete bar was roughly 10% done after 45 minutes – the other virtualization solutions would have been waiting at the first login screen at this point.

    My host CPU has the AMD VT technology, and the system has 4GB RAM and a 320GB HDD with roughly 70GB free so space/ram/CPU wouldn’t have been an issue.

    Is this the experience of others, or should I re-try with a different OS? (I live in Linux, but have to test and support against Windows so that gets virtualized all the time.)

    Dan

  2. Chris Says:

    A quick/small correction about virtualbox CLI – you can start/control VM’s from the CLI using VBoxManage. ie “VBoxManage startvm server –type vrdp”
    I use this to load some VM’s automatically on system bootup.

    @dan_linder – It may be that KVM isn’t using the AMD-V hardware virt stuff. Check that you had the ‘kvm’ and ‘kvm-amd’ kernel modules loaded. If not run ‘modprobe kvm-amd’ to load them

  3. Christopher Tozzi Says:

    Chris: thanks for the tips. I had never thought about writing a script to start VirtualBox VMs at boot. With KVM, of course, you can configure machines to start at boot in the libvirt configuration (assuming you’re using libvirt), so this is a relevant point.

  4. Jo-Erlend Schinstad Says:

    It is not difficult to choose between KVM and VirtualBox. If you have a desktop and want to run desktop guests, then VirtualBox is far superior at this point. When and if KVM gets support for dedicating a VGA to a guest, so you can have real 3D, this may change, but that’s not happening any time soon.

    If, on the other hand, you have headless servers and services that must always be available but preferably not too visible, then KVM with libvirt is a clear winner. If you run desktop guest systems on KVM, then you’ll certainly want to drop VNC as quickly as possible. Using RDP for Windows and NX for GNU+Linux, is _far_ superior.

    You cannot run accelerated VirtualBox and KVM at the same time, but if you close down all the guests from one, then it’s no problem to run the other.

  5. RDL Says:

    @ dan_linder:

    Lucid user here.

    That’s pretty much the same experience I had.

    But I’m not sure if it’s related to disk flushing issues; from what I understand, VirtualBox’s disk config is writeback by default, while KVM’s is writetrough, but I could be Oh-So-Wrong…

  6. [demo] How to run Windows XP on Linux Ubuntu with Virtualbox | Rainy Technology Says:

    [...] VirtualBox vs. KVM on the Desktop: A Comparison | WorksWithU [...]

  7. Jay Says:

    Would WorksWithU be willing to write up an “intro to virtualization” post for people who don’t know a lot about it and how it might be used for average end-users?

  8. Christopher Tozzi Says:

    Jay: good suggestion. I’ll see about putting something like that together in the coming weeks.

  9. Maxwell Spangler Says:

    The poor performance Dan Linder describes sounds as if his virtualization environment is running in software (QEMU) only mode. I almost wrote KVM off when using it on an old laptop because performance was unusable.

    On my four core AMD Phenom II 945 (four core, 6M L3 cache) system, KVM is as good as VirtualBox.

    I think we’ll see KVM win for server use and VirtualBox win for desktop users. A lot of this has to do with how Oracle handles VirtualBox in the future: tightening of licensing could be a huge boost for KVM.

  10. Phil Says:

    Well I will certainly unintsall VBox now. It looks as if now its dangerous to get tangled up in Oracle’s open source software. I’m guessing the Google law suit is only the beginning of pulling the rug from under you to get the profits they need from Sun.

Leave a Comment

Blog-Powered Site
By ContentRobot