1 Libguestfs is tools and a library for accessing and modifying guest
2 disk images. For more information see the home page:
6 For discussion, development, patches, etc. please use the mailing
9 http://www.redhat.com/mailman/listinfo/libguestfs
13 ----------------------------------------------------------------------
15 Running ./configure will check you have all the requirements installed
20 A useful tip is to run:
22 yum-builddep libguestfs
24 which will install all build dependencies automatically. If that is
25 successful, you don't need to bother with the rest of this section.
29 Take a look at the debian/control file and install everything listed
30 in "Build-Depends". If that is successful, you don't need to bother
31 with the rest of this section.
33 The full requirements are described below.
35 For basic functionality and the C tools:
37 - look at appliance/packagelist.in and install as many of the packages
38 that apply to your distro as possible
40 - recent QEMU >= 0.13 (0.14 or later is better) with virtio-serial support
42 - kernel >= 2.6.34 with virtio-serial support enabled.
44 - virtio-block and virtio-net drivers should be compiled into your
45 host kernel (strictly speaking this is optional, but you will have
46 to make complex changes to the ./configure command line to get it
47 to work if you don't have virtio)
49 - febootstrap >= 3.3 (it is best to use the latest version)
51 Notes: (1) febootstrap 2.x WILL NOT WORK
52 (2) febootstrap 3.x is distro-independent, and is required on
53 Debian and other distros as well as Fedora
55 - XDR, rpcgen (on Linux these are provided by glibc)
61 - pcre (Perl Compatible Regular Expressions C library)
63 - genisoimage (NOT mkisofs any more)
65 - hivex >= 1.2.7 (http://libguestfs.org/download) (optional)
67 - libmagic (the library that corresponds to the 'file' command) (optional)
73 - libconfig (optional)
75 - augeas >= 0.5.0 (http://augeas.net/) (optional)
77 - Berkeley DB 'db_dump' and 'db_load' utilities
78 (db4-utils or db4.X-util or similar) (optional)
80 - systemtap/DTrace userspace probes (optional)
81 http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps
83 - perldoc (pod2man, pod2text, pod2html) to generate the manual pages
84 and other documentation.
86 - Readline to have nicer command-line editing in guestfish (optional)
88 - xmllint (part of libxml2) to validate virt-inspector
89 RELAX NG schema (optional)
91 - OCaml if you want to rebuild the generated files, and
92 also to build the OCaml bindings (optional)
94 - po4a for translating manpages and POD files.
95 This is optional when compiling from the tarball, but mandatory
96 if you compile from git.
98 - getfacl, getfattr libraries and programs (optional)
100 To build FUSE support (guestmount):
102 - FUSE libraries and kernel module (optional)
104 To build virt-resize:
106 - OCaml PCRE bindings (ocaml-pcre) (optional)
108 To build language bindings:
110 - Perl if you want to build the perl bindings (optional)
112 - Python if you want to build the python bindings (optional)
114 - Ruby, rake if you want to build the ruby bindings (optional)
116 - Java, JNI, jpackage-utils if you want to build the java
119 - GHC if you want to build the Haskell bindings (optional)
121 - PHP, phpize if you want to build the PHP bindings (optional)
123 To build the Perl tools:
125 - Perl Sys::Virt module (optional)
127 - Perl Win::Hivex module (optional)
129 - Perl Pod::Usage module (optional)
131 - Perl Test::More module (from perl Test::Simple) (optional)
133 - Perl String::ShellQuote module (optional)
135 - perl-libintl for translating perl code (optional)
139 - xmlstarlet (optional)
141 - virt-sysprep also requires FUSE support since it uses guestmount
145 ----------------------------------------------------------------------
147 Then make the daemon, library and root filesystem:
152 Finally run the tests:
156 If everything works, you can install the library and tools by running
157 this command as root:
161 You can run guestfish, guestmount and the virt tools without needing
162 to install, using the "run" script in the top directory. This script
163 sets up some environment variables. For example:
165 ./run ./fish/guestfish [usual guestfish args ...]
167 ./run ./inspector/virt-inspector [usual virt-inspector args ...]
169 If you are already in the fish/ subdirectory, then the following
170 command will also work:
172 ../run ./guestfish [...]
174 You can also make a symlink (note: NOT a hard link) from your $PATH to
178 ln -s ~/libguestfs/run libguestfs-run
180 libguestfs-run ./inspector/virt-inspector [...]
182 You can also run the C programs under valgrind like this:
184 ./run valgrind [valgrind opts...] ./cat/virt-cat [virt-cat opts...]
186 This also works with sudo (eg. if you need root access for libvirt or
187 to access a block device):
189 sudo ./run ./cat/virt-cat -d LinuxGuest /etc/passwd
193 ----------------------------------------------------------------------
195 By far the most common problem is with broken or incompatible
198 Different versions of qemu have problems booting the appliance for
199 different reasons. This varies between versions of qemu, and Linux
200 distributions which add their own patches.
202 If you find a problem, you could try using your own qemu built from
203 source (qemu is very easy to build from source), with a 'qemu
204 wrapper'. Qemu wrappers are described in the guestfs(3) manpage.
208 ----------------------------------------------------------------------
210 By default the configure script will look for qemu-kvm (KVM support).
211 You will need a reasonably recent processor for this to work. KVM is
212 much faster than using plain Qemu.
214 You may also need to enable KVM support for non-root users, by following
217 http://www.linux-kvm.org/page/FAQ#How_can_I_use_kvm_with_a_non-privileged_user.3F
219 On some systems, this will work too:
223 On some systems, the chmod will not survive a reboot, and you will
224 need to make edits to the udev configuration.
228 ----------------------------------------------------------------------
230 On my machines I can usually rebuild the appliance in around 3
231 minutes. If it takes much longer for you, use a local distro mirror
234 To use squid to cache yum downloads, read this first:
235 https://lists.dulug.duke.edu/pipermail/yum/2006-August/009041.html
236 (In brief, because yum chooses random mirrors each time, squid doesn't
237 work very well with default yum configuration. To get around this,
238 choose a Fedora mirror which is close to you, set this with
239 './configure --with-mirror=[...]', and then proxy the whole lot
240 through squid by setting http_proxy environment variable).
242 You will also need to substantially increase the squid configuration
244 http://fedoraproject.org/wiki/Using_Mock_to_test_package_builds#Using_Squid_to_Speed_Up_Mock_package_downloads
247 Porting to other Linux distros / non-Linux
248 ----------------------------------------------------------------------
250 libguestfs itself should be fairly portable to other Linux
251 distributions. Non-Linux ports are trickier, but we will accept
252 patches if they aren't too invasive.
254 The main porting issues are with the dependencies needed to build the
255 appliance. You will need to port the febootstrap first
256 (http://people.redhat.com/~rjones/febootstrap/).
259 Copyright and license information
260 ----------------------------------------------------------------------
262 Copyright (C) 2009-2011 Red Hat Inc.
264 The library is distributed under the LGPLv2+. The programs are
265 distributed under the GPLv2+. Please see the files COPYING and
266 COPYING.LIB for full license information.