What is virtme?

Virtme is a set of simple tools to run a virtualized Linux kernel that uses the host Linux distribution instead of a separate image.

Virtme is tiny, easy to use, and makes testing kernel changes quite simple.

Some day this might be useful as a sort of sandbox. Right now it's not really configurable enough for that.

Virtme is hosted at kernel.org in utils/kernel/virtme/virtme.git (web | git). It's mirrored on github.

How to use virtme

You'll need a Linux kernel that has these options (built-in or as modules)


That kernel needs to be sane. Your kernel is probably sane, but allmodconfig and allyesconfig generate insane kernels. Sanity includes:


You may also have better luck if you set:


Your host system will need to satisfy some prerequisites:

  • You need a statically linked busybox binary somewhere in your path.
  • You need Python 3.3.
  • QEMU 1.6 or higher is recommended. QEMU 1.4 and 1.5 are partially supported using a rather ugly kludge.

Once you have such a kernel, run one of:

  • virtme-run --kimg PATH_TO_BZIMAGE
  • virtme-run --installed-kernel
  • virtme-run --installed-kernel VERSION

On x86, you can usually find a bzImage in arch/x86/boot/bzImage once you've compiled your kernel.

Note that the --kimg mode does not support modules.

You can then do things like cd /home/username and you will have readonly access to all your files.

Upcoming features

In the near term, the high-priority features are:

  • Support for modular virtfs and 9p for non-installed kernels.
  • Some way to configure writable mounts.