KVM on Fedora11

I've been a VMWare Workstation user for years and have generally been pretty happy with it; but it is significantly slower than bare metal, especially when it comes to disk i/o. One of my responsibilities for work is creating and maintaining a custom Fedora distribution. This requires building new rpm packages and then creating a livecd iso for the install of the system. Lots of disk i/o involved in reading and creating the disk image meant that I was running Fedora9 as my native desktop.

Last year I upgraded to a Core2 Duo system. Not realizing that some of them don't have virtualization support I bought the cheapest one that NewEgg had available at the time. After a bit of thrashing about I realized that the E2200 I had wouldn't support Xen, qemu or virtualbox. So I continued to use VMWare Workstation and a bare-metal Fedora9 installation for my build environment.

This wasn't too bad a first. That is until I added a second ACER 22" widescreen to my desktop and discovered that Fedora9 has trouble with the nVidia graphics chipset (GeForce 7050/nForce 610i) on this motherboard. The display resolution is squareish. On a widescreen monitor this results in everything looking short and fat. It isn't terribly noticeable, but does become annoying after using it all day.

Thanks to Moore's Law the prices on the low end Core2 Duo's (E3300) with virtualization support have dropped to the same level as the processor I bought last year. Last week I swapped in the new CPU (<10 minute job), and moved my development environment over to Fedora11 and it's excellent virtualization support using libvirt. I've mostly been using the GUI tools for setup and management and have been very happy with things so far.

One of the first things I needed to do was move the default storage pool onto my large drive (ok, 500G isn't really large by today's standards but it is the biggest one I have). I didn't quite get the concept of storage pools at first and was trying to specify a new path when I setup the new virt. Instead what you need to do is edit the storage of the host system, add a new pool using a directory of files on the larger drive, and then create a new image file in the pool for use with the virt you are going to setup.

The next hurdle was getting bridged networking setup. Some of the virts that I use are test images for production web servers (I like to virtualize and test as much of the production environment as possible). To do this I followed the directions over on the libvirt webpage, basically editing a couple of files in /etc/sysconfig/network-scripts.

ifcfg-eth0 now looks like this:

DEVICE=eth0
HWADDR=00:21:97:9e:e1:15
NM\_CONTROLLED=no
ONBOOT=yes
BRIDGE=br0

And a new file, ifcfg-br0 looks like this:

# Bridge device
DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
DELAY=0
NM\_CONTROLLED=no

After doing this I restarted networking and now br0 shows up as the default interface when setting up new virtuals with the GUI tools. One snag I ran into is that BOOTPROTO=dhcp is case sensitive -- DHCP will not work and will cause some amount of frustration until you realize this.

Within a couple of hours I was able to move my Fedora9 build and test environments over to virtuals, including the i/o intensive iso building process. I haven't made any objective measurements, but it runs almost as quickly as it did on the bare metal install and significantly faster than when I tried running it under VMWare. Now my screen runs properly, thanks to the nouveau driver used in Fedora11, and I can fire up more virtuals without bogging down the system like it would with VMWare. I may miss the snapshot option of VMware eventually, but for now the virt-clone utility works just fine for my needs.