10 Oct 2007 fab   » (Master)

Virtualization is a hot topic. For a lot of good reasons



Virtualization on Fedora

The virtualization in Fedora has been advertised early with the shipping of Xen. Xen requires that the host runs a specific kernel, that lags behind the most recent upstream kernel version. The Xen guys at RedHat made a terrific work to port the Xen changes to current kernel releases, but this looks like such a daunting task, that they have a hard time to follow upstream kernel.

A new solution has been developed, KVM, that has an invaluable advantage to be merged upstream, and to work with an unmodified kernel, just by loading a module into the system. KVM is an api exposed to userland via the /dev/kvm device, and that has been integrated into QEMU, so QEMU commands can work unmodified with KVM.

QEMU is an older emulator, not only for x86 architectures. Coupled with a kernel module (kqemu), it can provide a nice emulation speedup, compared to a pure userland emulation. This kernel module is not yet upstream. It was proprietary code until recently. Its license is now GPL.

RedHat also developed for Fedora an interesting framework, virt-manager and libvirt, that allows to manage virtual machines, in a way that is independent of the underlying virtualization technology available on the host. It can currently handle both Xen, and KVM.

QEMU features

QEMU simulates an HDD using a single disk partition or file on the host machine. It can use a disk image format allowing embedded snapshoted states of the virtual machine. Features include compressed storage, on-demand growing disk images. It is also possible to separate the disk image in two parts : a read-only disk image in one file (typically shared among several virtual machines), and a second writable disk image, specific to each virtual machine, that use the copy-on-write principle, to only store differences with the read-only base disk image.

QEMU networking is still a bit tricky to configure, if the virtual machine must be reachable on the real network. A bridge must be created, including the real network interface, and a tuntap virtual interface. This tuntap interface must be handled by a virtual network switch emulator, like vde2. Access to this virtual ethernet switch may be granted to a given user. This user can launch, and attach many QEMU instances to this switch. Each instance with a different MAC address, so that each one obtains a distinct IP address on the real network.

QEMU virtual machines management is easy if they are configured to launch a VNC server at startup.

Latest blog entries     Older blog entries