Using KQEMU in Ubuntu

QEMU allows you to run virtula images of OS's (like vmware).
KQEMU is a kernel module for qemu, it GREATLY improves QEMU performance.

KQEMU needs to be compiled from source (since it's a kernel module), however we will use module-assistant to greatly simplify this process.
sudo apt-get install module-assistant kqemu-source
sudo module-assistant auto-install kqemu

After a kernel upgrade you will need to rerun sudo module-assistant auto-install kqemu

Now. it's installed, however we need to do a few more things:
creating kqemu user & group
sudo addgroup --system kqemu
sudo adduser $USER kqemu 
# this will "update" your group list in your current shell, so you are part of 'kqemu' group right away.
newgrp kqemu

Edit UDEV rules
sudo vi /etc/udev/rules.d/60-kqemu.rules
KERNEL=="kqemu", NAME="%k", GROUP="kqemu", MODE="0660" 
sudo /etc/init.d/udev reload

Load kqemu module now:
manually load kqemu right away
sudo update-modules
sudo modprobe kqemu

If you want it to start automatically at boot add this to /etc/modules
Add to /etc/modules

Now we can start qemu and it should use kqemu now (it will show a warning on the console if it fails to use kqemu).

qemu -m 500M debian.qcow

If you don't have any qemu images yet, See here how to create one.


Add a new Comment