1 Libguestfs is a library for accessing and modifying guest disk images.
2 Amongst the things this is good for: making batch configuration
3 changes to guests, getting disk used/free statistics (see also:
4 virt-df), migrating between virtualization systems (see also:
5 virt-p2v), performing partial backups, performing partial guest
6 clones, cloning guests and changing registry/UUID/hostname info, and
9 Libguestfs uses Linux kernel and qemu code, and can access any type of
10 guest filesystem that Linux and qemu can, including but not limited
11 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
12 schemes, qcow, qcow2, vmdk.
14 Libguestfs provides ways to enumerate guest storage (eg. partitions,
15 LVs, what filesystem is in each LV, etc.). It can also run commands
16 in the context of the guest. Also you can access filesystems over
19 Libguestfs is a library that can be linked with C and C++ management
20 programs (or management programs written in OCaml, Perl, Python, Ruby,
21 Java, PHP, Haskell or C#). You can also use it from shell scripts or the
24 Libguestfs was written by Richard W.M. Jones (rjones@redhat.com) and
25 hacked on by lots of other people. For discussion, development,
26 patches, etc. please use the mailing list:
28 http://www.redhat.com/mailman/listinfo/libguestfs
32 ----------------------------------------------------------------------
34 http://libguestfs.org/
38 ----------------------------------------------------------------------
40 - recent QEMU >= 0.12 with virtio-serial support
42 - febootstrap >= 3.0 (recommended >= 3.3)
43 *NB*: febootstrap 2.x WILL NOT WORK
44 febootstrap 3.x is distro-independent, and is required on
45 Debian and other distros too
47 - XDR, rpcgen (on Linux these are provided by glibc)
49 - pcre (Perl Compatible Regular Expressions C library) (optional)
51 - libmagic (the library that corresponds to the 'file' command) (optional)
57 - Augeas (http://augeas.net/) (optional)
61 - squashfs-tools (mksquashfs only)
63 - genisoimage / mkisofs
65 - hivex >= 1.2.1 (http://libguestfs.org/download)
67 - (Optional) Berkeley DB 'db_dump' and 'db_load' utilities
68 (db4-utils or db4.X-util or similar)
70 - (Optional) FUSE to build the FUSE module
72 - perldoc (pod2man, pod2text, pod2html) to generate the manual pages
73 and other documentation.
75 - (Optional) Readline to have nicer command-line editing in guestfish.
77 - (Optional) xmllint to validate virt-inspector RELAX NG schema
79 - (Optional) OCaml if you want to rebuild the generated files, and
80 also to build the OCaml bindings
82 - (Optional) local Fedora mirror
84 - (Optional) Perl if you want to build the perl bindings
86 - (Optional) Python if you want to build the python bindings
88 - (Optional) Ruby, rake if you want to build the ruby bindings
90 - (Optional) Java, JNI, jpackage-utils if you want to build the java
93 - (Optional) GHC if you want to build the Haskell bindings
95 - (Optional) Perl Sys::Virt module.
97 - (Optional) Perl Win::Hivex module.
99 - (Optional) Perl Pod::Usage module.
101 - (Optional) Perl Test::More module (from perl Test::Simple).
103 - (Optional) Perl String::ShellQuote module.
105 - (Optional, but highly recommended) perl-libintl for translating perl code.
107 - (Optional) po4a for translating manpages and POD files.
109 - (Optional) PHP, phpize if you want to build the PHP bindings
111 Running ./configure will check you have all the requirements installed
116 ----------------------------------------------------------------------
118 Then make the daemon, library and root filesystem:
120 ./configure [--with-mirror=URI]
123 Use the optional --with-mirror parameter to specify the URI of a local
124 Fedora mirror. See the discussion of the MIRROR parameter in the
125 febootstrap(8) manpage.
127 Finally run the tests:
131 If everything works, you can install the library and tools by running
132 this command as root:
138 ----------------------------------------------------------------------
140 By far the most common problem is with broken or incompatible
143 Different versions of qemu have problems booting the appliance for
144 different reasons. This varies between versions of qemu, and Linux
145 distributions which add their own patches.
147 If you find a problem, you could try using your own qemu built from
148 source (qemu is very easy to build from source), with a 'qemu
149 wrapper'. Qemu wrappers are described in the guestfs(3) manpage.
153 ----------------------------------------------------------------------
155 By default the configure script will look for qemu-kvm (KVM support).
156 You will need a reasonably recent processor for this to work. KVM is
157 much faster than using plain Qemu.
159 You may also need to enable KVM support for non-root users, by following
162 http://www.linux-kvm.org/page/FAQ#How_can_I_use_kvm_with_a_non-privileged_user.3F
164 On some systems, this will work too:
168 On some systems, the chmod will not survive a reboot, and you will
169 need to make edits to the udev configuration.
173 ----------------------------------------------------------------------
175 Previous versions of libguestfs required something called "vmchannel".
176 Vmchannel is a special device given to virtual machines which allows
177 them to communicate in some way with the host, often (but not always)
178 without using a traditional network device. In reality, there is no
179 one thing called "vmchannel". This idea has been reimplemented
180 several times under the name vmchannel, and other hypervisors have
181 their own incompatible implementation(s) too.
183 In libguestfs <= 1.0.71, we required a specific vmchannel which is
184 properly known as "guestfwd" and has been upstream in qemu since here:
186 http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg01042.html
188 In libguestfs >= 1.0.71 we don't require any vmchannel implementation,
189 as long as qemu has been compiled with support for SLIRP (user mode
190 networking, or "-net user"), which is almost always the case.
192 In libguestfs >= 1.5.4 we switched again to using qemu's virtio-serial
193 and removed all the other vmchannels and the SLIRP channel.
197 ----------------------------------------------------------------------
199 In libguestfs >= 1.7.19 the supermin appliance is the default and only
200 supported form of appliance. For more information see febootstrap
201 (http://people.redhat.com/~rjones/febootstrap/).
205 ----------------------------------------------------------------------
207 On my machines I can usually rebuild the appliance in around 3
208 minutes. If it takes much longer for you, use a local Fedora mirror
211 To use squid to cache yum downloads, read this first:
212 https://lists.dulug.duke.edu/pipermail/yum/2006-August/009041.html
213 (In brief, because yum chooses random mirrors each time, squid doesn't
214 work very well with default yum configuration. To get around this,
215 choose a Fedora mirror which is close to you, set this with
216 './configure --with-mirror=[...]', and then proxy the whole lot
217 through squid by setting http_proxy environment variable).
219 You will also need to substantially increase the squid configuration
221 http://fedoraproject.org/wiki/Using_Mock_to_test_package_builds#Using_Squid_to_Speed_Up_Mock_package_downloads
224 Porting to other Linux distros / non-Linux
225 ----------------------------------------------------------------------
227 libguestfs itself should be fairly portable to other Linux
228 distributions. Non-Linux ports are trickier, but we will accept
229 patches if they aren't too invasive.
231 The main porting issues are with the dependencies needed to build the
232 appliance. You will need to port the febootstrap first
233 (http://people.redhat.com/~rjones/febootstrap/).
236 Copyright and license information
237 ----------------------------------------------------------------------
239 Copyright (C) 2009-2010 Red Hat Inc.
241 The library is distributed under the LGPLv2+. The programs are
242 distributed under the GPLv2+. Please see the files COPYING and
243 COPYING.LIB for full license information.