Thursday, March 20, 2008

Goodbye Xen, hello KVM

I've been pulling my hair out trying to get Xen to work with Ubuntu/Gutsy so that I could use Linux as my main Operating System and Windows could be run as a virtual machine.  I have been able to get that to work with lots of effort and recently, I haven't been able to go back to Xen because I really want to maintain my XGL wiggly windows.  So much so that I switched to VMware for a few months.

Now I am a happy camper using Linux's new kvm module.  What I never understood when reading about this module that is part of the main kernel trunk, is that the kvm module is just the context in which the hypervisor could be called.  The KVM module is really quiet stupid and simplistic.  It uses the Linux memory manager to manage all processes and calls to the virtual machine context and the kvm module is used to make all instructions called from a guest operating system safe for the host.  This is exactly what a kernel module should do; make hardware devices available to applications not make the applications.

Now with some modifications of the long time used qemu application (Under Ubuntu - called/ aliased as kvm) , we are able to upgrade to a really nice virtual machine solution.  I'm able to run KVM virtual machines with 100% Linux support for the host and offering a number of great features for the guest OSs.  For myself, that means I can run XGL on the host and run the virtual machines on flexible LVM drives directly, without filesystem containers or really any sort of hassles.

The big key is that you can now run Virtual Machines on Linux without giving up anything that Linux can do.  The only drawback is that there is no GUI interface but when starting a new machine is as easy as 'kvm -hda /dev/main/guest1'

Here is my bash script that runs my Windows XP virtual machine when I log onto my computer:
'kvm -no-acpi -no-reboot -m 512 -hda /dev/main/guest1 -cdrom /dev/cdrom -usb -smp2 -soundhw all'