Tag Archive : kvm

/ kvm

Running Kernel Image and RootFS on QEMU

December 5, 2015 | Article | No Comments

On previous article, we have discussed about QEMU installation on Slackware64. In this article we will discuss about how to test QEMU-KVM to run kernel image and rootfs, specifically for ARM embedded system.

In this article, I use:

  1. Slackware64 14.0
  2. Debian ARM

Our goal is to demonstrate QEMU for running kernel image and a rootfs. In specific, we will try to run a Debian installer.

Acquiring the Required Package

As stated before, we will use Debian for ARM. There are two files we need to obtain: the kernel and the initrd.gz. You can download them by using this command:

export SITE=ftp://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/versatile/netboot
wget ${SITE}/vmlinuz-3.2.0-4-versatile
wget ${SITE}/initrd.gz

You may create a directory if you want to keep all the files grouped.

Creating Raw Virtual Hard Disk

Next is creating raw virtual hard disk. At least we need 2GB for storage / image. For that purpose we can create image by:

qemu-img create -f raw hda.img 2G

The -f is for specifying what format of virtual hard drive, which is raw in this case.

Running Virtual Machine with QEMU

Now, the final step. We will running the virtual machine. To do that, invoke this command:

qemu-system-arm -m 256 -M versatilepb -kernel vmlinuz-3.2.0-4-versatile \
-initrd initrd.gz -hda hda.img -append

The command is actually self-explaining. We run machine and gives it 256MB RAM with kernel vmlinuz-3.2.0-4-versatile and initial ramdisk initrd.img, as downloaded.

Now, have fun 😀

Installing QEMU-KVM from Source

December 5, 2015 | Article | 9 Comments

Update: If you are searching for QEMU only installation, see here.

KVM stands for Kernel-based Virtual Machine, is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable Kernel module, kvm.ko, that provides the core virtualization infrastructure and processor specific module.

QEMU-KVM  is a QEMU modified for use with KVM.

Using KVM, one can run multiple virtual machines running unmodified Linux or Windows images.

In this article we will discuss about installing QEMU-KVM for Slackware64 14.0. Thus, we will use:

  1. Slackware64 14.0, although any version is OK
  2. qemu-kvm 1.2.0
  3. kvm-kmod
  4. zlib libraries and headers
  5. SDL libraries and headers
  6. alsa libraries and headers (optional for alsa support)
  7. gnutls libraries and headers (optional VNC TLS support)
  8. kernel source code and headers

Also in hardware parts, you need A VT capable Intel processor, or an SVM capable AMD processor.

Downloading the Source

Most Linux distros already have KVM kernel modules and userspace tools available. However, our purpose is to build our own from scratch, so we will need the source codes. However there are some note.

The source can be obtained from Sourceforge. Download the latest qemu-kvm source code here.


Next thing to do is doing configuration and make the binary code. Remember to use enough credentials to install. We will install it to /usr/local thus need root privilege. If you plan to install it elsewhere, need to make sure you have privilege to do it.

Now invoke following command:

tar -xzf qemu-kvm-1.2.0.tar.gz
cd qemu-kvm-1.2.0
./configure --prefix=/usr/local
make install

If you are using kernel from http://www.kernel.org/ do not use the kvm-mod modules. Use the provided modules (which is most likely already installed).

If you are using kernel 2.6 series, you have option to compile the modules by yourself. Which, you need to download kvm-kmod with version available for your kernel.

Now, to verify the kernel, test it by invoking following command:


Congratulation! You have installed qemu.

Social media & sharing icons powered by UltimatelySocial