ubuntu: Add extra suppressions for libnl.1 leaks.
[libguestfs.git] / README
1 Libguestfs is tools and a library for accessing and modifying guest
2 disk images.  For more information see the home page:
3
4   http://libguestfs.org/
5
6 For discussion, development, patches, etc. please use the mailing
7 list:
8
9   http://www.redhat.com/mailman/listinfo/libguestfs
10
11
12 Requirements
13 ----------------------------------------------------------------------
14
15 Running ./configure will check you have all the requirements installed
16 on your machine.
17
18 Fedora/RHEL users:
19
20   A useful tip is to run:
21
22     yum-builddep libguestfs
23
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.
26
27 Debian/Ubuntu users:
28
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.
32
33 The full requirements are described below.
34
35 For basic functionality and the C tools:
36
37 - look at appliance/packagelist.in and install as many of the packages
38   that apply to your distro as possible
39
40 - recent QEMU >= 0.13 (0.14 or later is better) with virtio-serial support
41
42 - kernel >= 2.6.34 with virtio-serial support enabled.
43
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)
48
49 - febootstrap >= 3.3 (it is best to use the latest version)
50
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
54
55 - XDR, rpcgen (on Linux these are provided by glibc)
56
57 - cpio
58
59 - gperf
60
61 - pcre (Perl Compatible Regular Expressions C library)
62
63 - genisoimage (NOT mkisofs any more)
64
65 - hivex >= 1.2.7 (http://libguestfs.org/download) (optional)
66
67 - libmagic (the library that corresponds to the 'file' command) (optional)
68
69 - libvirt (optional)
70
71 - libxml2 (optional)
72
73 - libconfig (optional)
74
75 - augeas >= 0.5.0 (http://augeas.net/) (optional)
76
77 - Berkeley DB 'db_dump' and 'db_load' utilities
78   (db4-utils or db4.X-util or similar) (optional)
79
80 - systemtap/DTrace userspace probes (optional)
81   http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps
82
83 - perldoc (pod2man, pod2text, pod2html) to generate the manual pages
84   and other documentation.
85
86 - Readline to have nicer command-line editing in guestfish (optional)
87
88 - xmllint (part of libxml2) to validate virt-inspector
89   RELAX NG schema (optional)
90
91 - OCaml if you want to rebuild the generated files, and
92   also to build the OCaml bindings (optional)
93
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.
97
98 - getfacl, getfattr libraries and programs (optional)
99
100 To build FUSE support (guestmount):
101
102 - FUSE libraries and kernel module (optional)
103
104 To build language bindings:
105
106 - Perl if you want to build the perl bindings (optional)
107
108 - Python if you want to build the python bindings (optional)
109
110 - Ruby, rake if you want to build the ruby bindings (optional)
111
112 - Java, JNI, jpackage-utils if you want to build the java
113   bindings (optional)
114
115 - GHC if you want to build the Haskell bindings (optional)
116
117 - PHP, phpize if you want to build the PHP bindings (optional)
118
119 To build the Perl tools:
120
121 - Perl Sys::Virt module (optional)
122
123 - Perl Win::Hivex module (optional)
124
125 - Perl Pod::Usage module (optional)
126
127 - Perl Test::More module (from perl Test::Simple) (optional)
128
129 - Perl String::ShellQuote module (optional)
130
131 - perl-libintl for translating perl code (optional)
132
133 To run virt-sysprep:
134
135 - virt-sysprep requires FUSE support since it uses guestmount
136
137
138 Building
139 ----------------------------------------------------------------------
140
141 Then make the daemon, library and root filesystem:
142
143   ./configure
144   make
145
146 Finally run the tests:
147
148   make check
149
150 There are some extra tests, but these require that you have some
151 libvirt guests installed, that these guests' disks are accessible by
152 the current user, and these tests may fail for other reasons which are
153 not necessarily because of real problems.  If you want to run these
154 extra tests do:
155
156   make extra-tests
157
158 If everything works, you can install the library and tools by running
159 this command as root:
160
161   make install
162
163 You can run guestfish, guestmount and the virt tools without needing
164 to install, using the "run" script in the top directory.  This script
165 sets up some environment variables.  For example:
166
167   ./run ./fish/guestfish [usual guestfish args ...]
168
169   ./run ./inspector/virt-inspector [usual virt-inspector args ...]
170
171 If you are already in the fish/ subdirectory, then the following
172 command will also work:
173
174   ../run ./guestfish [...]
175
176 You can also make a symlink (note: NOT a hard link) from your $PATH to
177 the run script, eg:
178
179   cd ~/bin
180   ln -s ~/libguestfs/run libguestfs-run
181   cd ~/libguestfs
182   libguestfs-run ./inspector/virt-inspector [...]
183
184 You can also run the C programs under valgrind like this:
185
186   ./run valgrind [valgrind opts...] ./cat/virt-cat [virt-cat opts...]
187
188 This also works with sudo (eg. if you need root access for libvirt or
189 to access a block device):
190
191   sudo ./run ./cat/virt-cat -d LinuxGuest /etc/passwd
192
193
194 qemu
195 ----------------------------------------------------------------------
196
197 By far the most common problem is with broken or incompatible
198 qemu releases.
199
200 Different versions of qemu have problems booting the appliance for
201 different reasons.  This varies between versions of qemu, and Linux
202 distributions which add their own patches.
203
204 If you find a problem, you could try using your own qemu built from
205 source (qemu is very easy to build from source), with a 'qemu
206 wrapper'.  Qemu wrappers are described in the guestfs(3) manpage.
207
208
209 Note on using KVM
210 ----------------------------------------------------------------------
211
212 By default the configure script will look for qemu-kvm (KVM support).
213 You will need a reasonably recent processor for this to work.  KVM is
214 much faster than using plain Qemu.
215
216 You may also need to enable KVM support for non-root users, by following
217 these instructions:
218
219   http://www.linux-kvm.org/page/FAQ#How_can_I_use_kvm_with_a_non-privileged_user.3F
220
221 On some systems, this will work too:
222
223   chmod o+rw /dev/kvm
224
225 On some systems, the chmod will not survive a reboot, and you will
226 need to make edits to the udev configuration.
227
228
229 Mirroring tip
230 ----------------------------------------------------------------------
231
232 On my machines I can usually rebuild the appliance in around 3
233 minutes.  If it takes much longer for you, use a local distro mirror
234 or squid.
235
236 To use squid to cache yum downloads, read this first:
237 https://lists.dulug.duke.edu/pipermail/yum/2006-August/009041.html
238 (In brief, because yum chooses random mirrors each time, squid doesn't
239 work very well with default yum configuration.  To get around this,
240 choose a Fedora mirror which is close to you, set this with
241 './configure --with-mirror=[...]', and then proxy the whole lot
242 through squid by setting http_proxy environment variable).
243
244 You will also need to substantially increase the squid configuration
245 limits:
246 http://fedoraproject.org/wiki/Using_Mock_to_test_package_builds#Using_Squid_to_Speed_Up_Mock_package_downloads
247
248
249 Porting to other Linux distros / non-Linux
250 ----------------------------------------------------------------------
251
252 libguestfs itself should be fairly portable to other Linux
253 distributions.  Non-Linux ports are trickier, but we will accept
254 patches if they aren't too invasive.
255
256 The main porting issues are with the dependencies needed to build the
257 appliance.  You will need to port the febootstrap first
258 (http://people.redhat.com/~rjones/febootstrap/).
259
260
261 Copyright and license information
262 ----------------------------------------------------------------------
263
264 Copyright (C) 2009-2011 Red Hat Inc.
265
266 The library is distributed under the LGPLv2+.  The programs are
267 distributed under the GPLv2+.  Please see the files COPYING and
268 COPYING.LIB for full license information.