10 Libguestfs is a C library for accessing and creating
11 disk images. It has been in development for four and a half
12 years, is very mature, and is used in many large projects
13 such as: virt-v2v, OpenStack,
15 Like libvirt, the C API is long term stable so a program
16 written against the API four years ago will still work today.
18 There are bindings in lots of programming languages.
19 Here is an example of a Python program using the API to create a
20 partitioned disk image with some content from a tar file.
26 virt-filesystems -a disk.img --all --long -h
28 virt-df -a disk.img -h
30 guestfish --ro -a disk.img -m /dev/sda1 find /
40 We have a lot of tools associated with libguestfs:
46 Today I want to just mention virt-builder which is a tool
47 for rapidly and safely customizing templates of virtual
52 virt-builder fedora-19 \
53 --hostname f19.example.com \
54 --firstboot-install nmap \
55 --edit '/etc/yum.conf: s/gpgcheck=1/gpgcheck=0/'
58 [---- LIBVIRT INTEGRATION ---]
60 How libguestfs uses libvirt:
62 Behind the scenes we create a captive appliance. Since Fedora 18 &
63 RHEL 7, we use libvirt to manage the appliance and sVirt to protect
64 the host from rogue filesystems.
67 Our use of libvirt APIs is very simple:
69 - "lifecycle APIs" like virDomainCreateXML
74 What we DON'T care about:
85 - <cpu mode="host-model"> (WORKAROUND)
86 - qemu: could not load kernel ... Permission denied
87 - libvirt doesn't label backing sockets, eg. qcow2 using NBD backing
88 - could not destroy libvirt domain: Requested operation is not valid: domain is not running
89 - libvirt chown's <kernel> file to root, but doesn't restore ownership
90 - XML error: No PCI buses available (FIXED)
91 - This QEMU doesn't support virtio scsi controller (qemu bug: FIXED)
92 (example of non-obvious error message)
93 - TMPDIR / environment variable handling is broken (WORKAROUND)
95 Missing features in libvirt:
97 - labelling backing sockets
98 - no way to specify net= parameter to qemu
101 Things we don't like:
103 - error messages are confusing, real information is hidden
104 - logging/debugging is hard
107 - essentially impossible to use libvirt/sVirt on anything except Fedora/RHEL
112 - having someone else deal with qemu