Lguest is designed to be a minimal 32-bit x86 hypervisor for the Linux kernel, for Linux developers and users to experiment with virtualization with the minimum of complexity. Nonetheless, it should have sufficient features to make it useful for specific tasks, and, of course, you are encouraged to fork and enhance it (see drivers/lguest/README). Lguest was introduced in Linux 2.6.23.


Lguest userland tool in Debian

Don't look for a lguest package or ITP, lguest is a simple/sample user land tool, which source code is provided with Linux kernel documentation.

You can easily create it using this script: lguest-pkg-builder-0.4.sh The generated package is named like lguest-2.6.30-2-686_0.02_i386.deb, and it includes a wrapper that makes a few sanity checks.

The user land is specific to a kernel version. You need to compile lguest each time you change your kernel.

Using lguest as non-root user

lguest can be used by non-root user, assuming that (read/write) permissions are granted, typically by running:

Alternatively, you can use this method (which survives reboot):

Creating a Debian Image

lguest images must use lguest virtual devices:

Here's a script to create raw disk images lguest-create-img-0.02.sh, using debootstrap. The script generate a launcher script, which basically runs:

Side note: The same image can be used with qemu-system-i386 (assuming that inittab still has one tty on a /dev/tty* entry). Also root= needs to be updated on the command line vda)

Frequent errors

We've listed some known/frequent errors.

unhandled trap

For unhandled trap you might want to have a look at the function lguest_arch_handle_trap in http://git.kernel.org/...../drivers/lguest/x86/core.c.

The trap 13 are General Protection Fault. There are lots of reason why it can occur...

Failed to open /dev/lguest

Attaching eventfd: Invalid argument

lguest: bad syscall vector


See also

important information

removed in kernel version 4.14 (November 2017). see lguest wikipedia page. see also Closing the curtain on lguest (and this mailing list!)

CategorySoftware CategoryVirtualization