Experimental User-Mode Linux backend for libguestfs

I have just pushed an experimental User-Mode Linux (UML) backend for libguestfs ≥ 1.23.15. What this means is you can now try using UML instead of KVM, which may be more lightweight and/or faster for you.

Update: The User Mode Linux book is available as a free PDF download from the publisher here.

If your distro doesn’t ship UML, you will need to compile UML from source. This was very straightforward and took me only 5 minutes following these instructions.

You will also need to install uml_utilities (specifically we need the uml_mkcow program to work around a bug in UML).

Set LIBGUESTFS_BACKEND=uml and LIBGUESTFS_QEMU to point to the UML “linux” or “vmlinux” program that you compiled. (Note that we’re just reusing the “qemu” variable name for convenience; when using UML, qemu/KVM is not involved).

You can try using guestfish or other virt tools as normal (being an experimental backend, they may not work quite right …)

$ export LIBGUESTFS_QEMU=/home/rjones/d/linux/vmlinux
$ guestfish -a /tmp/test1.img

Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run
><fs> list-filesystems
/dev/ubda1: ext2
><fs> mount /dev/ubda1 /
><fs> ll /
total 17
drwxr-xr-x  3 root root  1024 Aug 11 20:46 .
drwxr-xr-x 23 1000 1000  4096 Aug 11 20:54 ..
-rw-r--r--  1 root root     0 Aug 11 18:31 foobar
-rw-r--r--  1 root root     0 Aug 11 18:35 foobarbar
-rw-r--r--  1 root root     0 Aug 11 20:46 foobarbarbar
drwx------  2 root root 12288 Aug  9 22:47 lost+found

The main restriction of the UML backend is that only raw format disks are supported, no qcow2, no NBD or other remote storage.


Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.