The new version has been rebuilt around WebKit (all the work for this was done by Dan Berrange). Mozilla were never really serious about “MozEmbed”, and in practice it crashed all the time. WebKit (or KHTML as we like to call it) is built from the ground up for embedding and it is rock solid, so it was just better to switch.

Also in this development version is support for VTE, which is a simpler way to display terminal output. Any shell script called *.term is rendered in a built-in VTE terminal emulator. You can still use *.sh for shell scripts that you want to run during your presentation (eg. for using your own terminal, or just running arbitrary programs).

Tech Talk PSE is technical demonstration software which doesn’t suck. It uses Mozilla’s rendering engine to display slides, so it’s easy to use (just write HTML) and powerful. And you can intersperse your talk with shell scripts to run demonstrations.

New in version 1.0.0 is a menu that lets you jump straight to different parts of your talk and take screenshots:

I think that Tech Talk PSE may be one of the best programs I’ve ever written. Let’s compare it to “OpenOffice Impress”:

OpenOffice

Tech Talk PSE

Open source

Yes

Yes

Play videos

Yes

Yes

Open a shell during a talk

No

Yes

Use your own editor

No

Yes

Induces RSI during use

Mouse-controlled

Keyboard-controlled

Lines of code

109 (approx)

850

Comes in Platinum edition

No

Yes

It’s better than OpenOffice on any measure. Yet even if you include all the autoconf, documentation and examples, it’s only 1 kLoC and was written over 3 days in my spare time. For giving technical demonstrations, it’s totally “Right”, where OpenOffice is basically “Wrong”.

But how do you do this? It seems like either I want to put a regular button into a GtkMenuBar, or else put a drop-down menu button into the GtkButtonBox that we currently use to hold the next/prev buttons.

Back in 2008 we faced a pressing problem with virtualization. How do we look at what’s going on inside a virtual machine?

Let’s step back: what is a virtual machine? In nuts and bolts terms, it’s a big file or partition containing a disk image, and when it’s running, it’s a complicated emulation of CPUs, memory, and virtual devices like network cards. It’s interesting and necessary to be able to look inside all of those things. (“How many packets are coming out of the virtual network card?” “How is the virtual CPU coping with the load?”). But for the purpose of this talk I’m just going to talk about looking inside that disk image.

That large (multi-gigabyte) disk image file has a rich internal structure: a Master Boot Record; a boot partition; LVM, which has its own internal structures. Then it contains filesystems and those contain directories and files and more besides.

What might we want to do with the disk image if we could look inside it at this rich internal structure? Clone the machine, changing a few config files like the hostname. Edit grub.conf in a VM which isn’t booting. Audit a VM to find out what licensed software is installed. Is the VM running out of disk space? Offline resizing or backups. Make a new virtual machine from scratch …

In 2008 (and now) you could look inside the disk image. First of all you’d need to be root. Then you could run a command line tool called kpartx which splits the disk image partitions into device mapper devices (this is why you need to be root). These are actually global devices on your host, visible to everyone. If you’re lucky, LVM on the host might find the volume groups located in the disk image, but you might have to adjust the global host LVM configuration to get that to work. If you’re unlucky, those could conflict with volume groups already in your host.

So if you are root, you should usually be able to mount a guest disk in the host. If your program crashes, of course, it will leave unattached device mapper devices, loopback devices and mount points on the host system.

It’s not clear from a security point of view if mounting untrusted guest devices on the host as root is a good idea.

That said, kpartx is a useful tool if: you are already root on the host, you just want to mount a partition, it’s ad hoc (no scripting), you can clean up if you make a mistake, and if you can trust the guests.

So we considered how we could improve this process and provide more features.

You shouldn’t need to be root: If you have a word-processor document, you don’t need to be root to edit that document. If you have a JPEG file, you don’t need to run GIMP as root to crop it. So why are disk image files any different? You should be able to modify disk images from CGI scripts, or from shell scripts. You shouldn’t have to clean up after it. There should be no gotchas or corner cases where it doesn’t work.

What is libguestfs? An API for creating, accessing, manipulating and modifying filesystems and disk images. Access from many different programming languages, or the command line. A set of useful tools. And applications built on top.

Today is going to be mainly a demonstration of what can be done with libguestfs and the tools we’ve built around this.

[Demonstration of guestfish]

“Guestfish” is the “guest filesystem interactive shell”, and you can just run it on any disk image you happen to find. You don’t need to be root, unless you need root to access that particular image. In this case, the image is just a local file so I don’t need root.

About the author

I am Richard W.M. Jones, a computer programmer. I have strong opinions on how we write software, about Reason and the scientific method. Consequently I am an atheist [To nutcases: Please stop emailing me about this, I'm not interested in your views on it] By day I work for Red Hat on all things to do with virtualization.

My motto is "often wrong". I don't mind being wrong (I'm often wrong), and I don't mind changing my mind.

This blog is not affiliated or endorsed by Red Hat and all views are entirely my own.