Main PageAwards and FellowshipsDetailed ResumeProjectsSelected Publications



Virtualization with Qemu, Kqemu and KVM

This page presents: 

Introduction and Disclaimer :)

Disclaimer: I resume here what I have learned about the virtualization with the QEMU/KQEMU/KVM tools. I DO NOT assume any responsibility about rights and wrongs of what you find here.  These are my understandings of the tool, they can be right or wrong, so if you are using the information, evaluate it by yourself first.   Other thing is that, this is a "hands on" kind of tutorial, so if you are searching why and how... maybe here is not the best place to search for them, sorry :(. 

Qemu is a virtualization tool that started, and is maintained by Fabrice Bellard, the main pages are QEMU, KQEMU and KVM. There are many, really many, information sources about these tools. I think these tools became even MORE popular after the linux kernel introduce support for them (kvm) by default.  

What we will discuss here are related to debian based distributions, what does include ubuntu. Attention that KVM will work ONLY if you have a newer processor with support to virtualization (e.g. Intel Core duo or AMD Athlon or Turion), other thing is that KVM is based in QEMU, but is an independent project. The basic difference, for the user point of view, between KVM, Kqemu and Qemu is the perceived speed but the procedures are basically the same. 

Other good tutorials and information sources can be found at:


Conventions: 

Installation

Disk Images

host #> modprobe kqemu
host #> rm -rf /dev/kqemu
host #> mknod /dev/kqemu c 250 0
host #> /bin/chmod 666 /dev/kqemu  ##Comment## make it accessible to all users
host #> qemu -m 200 rtmk_linux-2.6.16.49.img&

Network Configuration

host #> tunctl -d tap0
 Set 'tap0' persistent and owned by uid 1000

 

host #> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
host #> echo 1 > /proc/sys/net/ipv4/ip_forward

 

host #> cat > qemu-ifup.sh

#!/bin/sh
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
#sleep 2

Configuring the client 

For every day usage

If you are following this as a step by step tutorial, up to here it is one time only, you will need to do every thing that is below only once, here we will discuss the every day use, what you need to do daily make the thing work.


© Daniel Câmara
Last revised: Aug/20/2007 (_camara@NoSpamPlease_eurecom.fr)