Review of KVM virtualization under Ubuntu server 12.04

Posted on May 1st, 2012 by David Luhman and tagged .

In my discussion of my home-based server, setting up an Ubuntu 12.04 server and using its "native" KVM virtualization technology was one virtualization solution.

Up to this point, I had never tried KVM, although I had dabbled a bit with QEMU which appears to be a part of KVM.

Installation

Installing Ubuntu 12.04 from USB had one wrinkle. I found that if I used YUMI to create a bootable USB from an .iso, the Ubuntu installer had trouble finding the "CD-ROM" for the installer files. Creating the bootable USB with Unetbootin solved this problem.

Installing KVM in the default Ubuntu 12.04 server was relatively straight-forward. Here are a couple posts I found useful for this :

https://help.ubuntu.com/community/KVM/Installation

http://www.itworld.com/virtualization/216949/crash-course-virtualization...

There was one wrinkle alluded to in the above docs. It seemed like I needed to add myself to the following groups to get virtualization to work :


$ sudo adduser `id -un` kvm
$ sudo adduser `id -un` libvirtd

I wanted to have a light-weight windowing system on my HP MicroServer, so I went ahead and added LXDE and started the KVM virtual machine manager with the following :


$ sudo apt-get install lxde
$ virt-manager -c qemu:///system kvmhost

User experience

The KVM GUI manager worked pretty well, considering it's "free" software. I was able to setup VMs pretty easily, and they worked pretty much without a hitch.

Still, there seemed to be some loose ends. Help in the VM setup wizard was pretty sparse. I got a couple inexplicable warnings or error messages. I had trouble switching networking from NAT to bridged.

Most of this can probably be worked through by reading the docs. It seems like the Linux community is just now starting to coalesce around KVM as the leading virtualization solution, so some of these rough edges will probably disappear over time.

Lack of snapshots

I didn't see any snapshot controls from the KVM VM management GUI. A quick web search turned up the following resource (among others) regarding KVM snapshots :

http://redes-privadas-virtuales.blogspot.com/2011/05/taking-snapshots-on...

The above is a command line method to create snapshots. This is fine, and definitely desired for automated processes, but not really suitable for casual or ad hoc use.

Cloning

Cloning was one area where KVM did pretty well. In the VM management GUI, you can simply choose to "Clone" a VM, and it's a simple process. However, I seemed to have hit a snag with respect to virtual network cards. It seemed like the MAC addresses may have been duplicated, so I was getting some kind of network error on boot. I removed and re-added a network card, switched from bridged networking back to the default NAT, and rebooted and things went OK.

Performance

I provide details on performance, but relative to Hyper-V and ESXi, KVM was a bit slower in both CPU-intensive I/O-intensive tests.

Comments

about snapshots

You refer to an article about taking snapshots with LVM, but they are only a short term solution and degrade performance considerably the more snapshots you take and they definately waste a lot of space. Each snapshot grows in size while you write data to your volume (and if you are cloning the situation is even worse).
LVM is not a structural solution to take several snapshots of your virtual machines.

You might take a look at ZFS On Linux (ZoL) if you want a better structural solution.

Comment by Christof (not verified) on May 6th, 2012 at 6:32 am

GUI for KVM

If have server on Ubuntu 12.04 then you can use to manage http://www.webvirtmgr.net

Comment by Anonymous (not verified) on Jun 6th, 2012 at 8:31 am

ZFS instead of snapshots

@Christof

Thanks for the comment. I've heard a lot of good comments about the ZFS file system. One thing really appealing about ZFS is its reported ability to prevent file corruption. I'll see if I can work with it in the future.

Comment by David Luhman on Jun 7th, 2012 at 5:55 pm