cefcd78189465281668b18a318e30b61ada286e0
[libguestfs.git] / README
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
7 much else besides.
8
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.
13
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 FTP.
17
18 Libguestfs is a library that can be linked with C and C++ management
19 programs (or management programs written in OCaml, Perl, Python, Ruby, Java
20 or Haskell).  You can also use it from shell scripts or the command line.
21
22 Libguestfs was written by Richard W.M. Jones (rjones@redhat.com).
23 For discussion please use the fedora-virt mailing list:
24
25   https://www.redhat.com/mailman/listinfo/fedora-virt
26
27
28 Requirements
29 ----------------------------------------------------------------------
30
31 - recent QEMU >= 0.10 with vmchannel support
32   http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg01042.html
33
34 - febootstrap >= 2.0
35
36 - XDR, rpcgen
37
38 - (Optional) Augeas (http://augeas.net/)
39
40 - perldoc (pod2man, pod2text) to generate the manual pages and
41 other documentation.
42
43 - (Optional) Readline to have nicer command-line editing in guestfish.
44
45 - (Optional) OCaml if you want to rebuild the generated files, and
46 also to build the OCaml bindings
47
48 - (Optional) local Fedora mirror
49
50 - (Optional) Perl if you want to build the perl bindings
51
52 - (Optional) Python if you want to build the python bindings
53
54 - (Optional) Ruby, rake if you want to build the ruby bindings
55
56 - (Optional) Java, JNI, jpackage-utils if you want to build the java
57 bindings
58
59 - (Optional) GHC if you want to build the Haskell bindings
60
61 Running ./configure will check you have all the requirements installed
62 on your machine.
63
64
65 Building
66 ----------------------------------------------------------------------
67
68 Then make the daemon, library and root filesystem:
69
70   ./configure [--with-mirror=URI]
71   make
72
73 Use the optional --with-mirror parameter to specify the URI of a local
74 Fedora mirror.  See the discussion of the MIRROR parameter in the
75 febootstrap(8) manpage.
76
77 Finally run the tests:
78
79   make check
80
81 If everything works, you can install the library and tools by running
82 these commands as root:
83
84   make install
85
86
87 Note on using KVM
88 ----------------------------------------------------------------------
89
90 If you are using x86-64, then by default the configure script will
91 look for qemu-kvm (KVM support).  You will need a reasonably recent
92 processor for this to work.  KVM is much faster than using plain QEMU.
93
94 You may also need to enable KVM support for non-root users, by following
95 these instructions:
96
97   http://www.linux-kvm.org/page/FAQ#How_can_I_use_kvm_with_a_non-privileged_user.3F
98
99 On some systems, this will work too:
100
101   chmod o+rw /dev/kvm
102
103 On some systems, the chmod will not survive a reboot, and you will
104 need to make edits to the udev configuration.
105
106
107 Notes on cross-architecture support
108 ----------------------------------------------------------------------
109
110 At the moment we basically don't support cross-architecture or
111 32-on-64.  This limits what is possible for some guests.  Filesystem
112 operations and FTP export will work fine, but running commands in
113 guests may not be possible.
114
115 To enable this requires work for cross-architecture and 32-on-64
116 support in febootstrap, fakeroot and fakechroot.
117
118 The daemon/ directory contains its own configure script.  This is so
119 that in future we will be able to cross-compile the daemon.
120
121
122 Mirroring tip
123 ----------------------------------------------------------------------
124
125 Having a local Fedora mirror makes a massive difference to the time it
126 takes to build and rebuild initramfs images.
127
128 Failing that, use squid to cache yum downloads, but read this first:
129 https://lists.dulug.duke.edu/pipermail/yum/2006-August/009041.html
130 (In brief, because yum chooses random mirrors each time, squid doesn't
131 work very well with default yum configuration.  To get around this,
132 choose a Fedora mirror which is close to you, set this with
133 './configure --with-mirror=[...]', and then proxy the whole lot
134 through squid by setting http_proxy environment variable).
135
136 You will also need to substantially increase the squid configuration
137 limits:
138 http://fedoraproject.org/wiki/Using_Mock_to_test_package_builds#Using_Squid_to_Speed_Up_Mock_package_downloads
139
140 IntelligentMirror is another possibility, although I couldn't get it
141 to work for me.
142
143
144 Copyright and license information
145 ----------------------------------------------------------------------
146
147 Copyright (C) 2009 Red Hat Inc.
148
149 The library is distributed under the LGPLv2+.  The programs are
150 distributed under the GPLv2+.  Please see the files COPYING and
151 COPYING.LIB for full license information.