blob: 52124b87a5e2d86e40d96b20b87fc8e94175eacb [file] [log] [blame]
Native Linux KVM tool
kvmtool is a lightweight tool for hosting KVM guests. As a pure virtualization
tool it only supports guests using the same architecture, though it supports
running 32-bit guests on those 64-bit architectures that allow this.
From the original announcement email:
The goal of this tool is to provide a clean, from-scratch, lightweight
KVM host tool implementation that can boot Linux guest images (just a
hobby, won't be big and professional like QEMU) with no BIOS
dependencies and with only the minimal amount of legacy device
It's great as a learning tool if you want to get your feet wet in
virtualization land: it's only 5 KLOC of clean C code that can already
boot a guest Linux image.
Right now it can boot a Linux image and provide you output via a serial
console, over the host terminal, i.e. you can use it to boot a guest
Linux image in a terminal or over ssh and log into the guest without
much guest or host side setup work needed.
This is the stand-alone version which does not live inside a Linux
kernel tree.
1. To check it out, clone the main git repository:
git clone git://
2. Compile the tool (for more elaborate instructions see INSTALL):
cd kvmtool && make
3. Download a raw userspace image:
wget && bunzip2
4. The guest kernel has to be built with the following configuration:
- For the default console output:
- For running 32bit images on 64bit hosts:
- Proper FS options according to image FS (e.g. CONFIG_EXT2_FS, CONFIG_EXT4_FS).
- For all virtio devices listed below:
- For virtio-blk devices (--disk, -d):
- For virtio-net devices ([--network, -n] virtio):
- For virtio-9p devices (--virtio-9p):
- For virtio-balloon device (--balloon):
- For virtio-console device (--console virtio):
- For virtio-rng device (--rng):
- For vesa device (--sdl or --vnc):
5. And finally, launch the hypervisor:
./lkvm run --disk linux-0.2.img \
--kernel ../../arch/x86/boot/bzImage \
sudo ./lkvm run --disk linux-0.2.img \
--kernel ../../arch/x86/boot/bzImage \
--network virtio
The tool has been written by Pekka Enberg, Cyrill Gorcunov, Asias He,
Sasha Levin and Prasad Joshi. Special thanks to Avi Kivity for his help
on KVM internals and Ingo Molnar for all-around support and encouragement!
See the following thread for original discussion for motivation of this
Another detailed example can be found in the article:
Please send patches for kvmtool to, in the usual git
patch format, including "kvmtool" in the mail subject. "kvmtool" can be
added automatically by issuing the command
git config format.subjectprefix "PATCH kvmtool"
in the git repository.