Added OCaml examples.
[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 other languages, if people
20 contribute the language bindings).  You can also use it from shell
21 scripts or the command line.
22
23 Libguestfs was written by Richard W.M. Jones (rjones@redhat.com).
24 For discussion please use the fedora-virt mailing list:
25
26   https://www.redhat.com/mailman/listinfo/fedora-virt
27
28
29 Requirements
30 ----------------------------------------------------------------------
31
32 - recent QEMU with vmchannel support
33
34 - febootstrap >= 1.2
35
36 - XDR, rpcgen
37
38 - perldoc (pod2man, pod2text) to generate the manual pages and
39 other documentation.
40
41 - (Optional) OCaml if you want to modify the code or rebuild certain
42 generated files, and also to build the OCaml bindings
43
44 - (Optional) local Fedora mirror
45
46 - (Optional) Perl if you want to build the perl bindings
47
48 Running ./configure will check you have all the requirements installed
49 on your machine.
50
51
52 Building
53 ----------------------------------------------------------------------
54
55 Then make the daemon, library and root filesystem:
56
57   ./configure [--with-mirror=URI]
58   make
59
60 Use the optional --with-mirror parameter to specify the URI of a local
61 Fedora mirror.  See the discussion of the MIRROR parameter in the
62 febootstrap(8) manpage.
63
64 Finally run the tests:
65
66   make check
67
68 If everything works, you can install the library and tools by running
69 these commands as root:
70
71   make install
72
73
74 Notes on cross-architecture support
75 ----------------------------------------------------------------------
76
77 At the moment we basically don't support cross-architecture or
78 32-on-64.  This limits what is possible for some guests.  Filesystem
79 operations and FTP export will work fine, but running commands in
80 guests may not be possible.
81
82 To enable this requires work for cross-architecture and 32-on-64
83 support in febootstrap, fakeroot and fakechroot.
84
85 The daemon/ directory contains its own configure script.  This is so
86 that in future we will be able to cross-compile the daemon.
87
88
89 Mirroring tip
90 ----------------------------------------------------------------------
91
92 Having a local Fedora mirror makes a massive difference to the time it
93 takes to build and rebuild initramfs images.
94
95 Failing that, use squid to cache yum downloads, but read this first:
96 https://lists.dulug.duke.edu/pipermail/yum/2006-August/009041.html
97 (In brief, because yum chooses random mirrors each time, squid doesn't
98 work very well with default yum configuration.  To get around this,
99 choose a Fedora mirror which is close to you, set this with
100 './configure --with-mirror=[...]', and then proxy the whole lot
101 through squid by setting http_proxy environment variable).
102
103 You will also need to substantially increase the squid configuration
104 limits:
105 http://fedoraproject.org/wiki/Using_Mock_to_test_package_builds#Using_Squid_to_Speed_Up_Mock_package_downloads
106
107 IntelligentMirror is another possibility, although I couldn't get it
108 to work for me.
109
110
111 Copyright and license information
112 ----------------------------------------------------------------------
113
114 Copyright (C) 2009 Red Hat Inc.
115
116 The library is distributed under the LGPLv2+.  The programs are
117 distributed under the GPLv2+.  Please see the files COPYING and
118 COPYING.LIB for full license information.