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 mount guest filesystems on
17 the host (requires root privs and NFS).
19 libguestfs is a library that can be linked with C and C++ management
20 programs (or management programs written in other languages, if people
21 contribute the language bindings). You can also use it from shell
22 scripts or the command line.
24 libguestfs was written by Richard W.M. Jones (rjones@redhat.com).
25 For discussion please use the fedora-virt mailing list:
27 https://www.redhat.com/mailman/listinfo/fedora-virt
31 ----------------------------------------------------------------------
33 - nfs-utils source, unpacked
34 http://download.sourceforge.net/nfs
36 - Recent QEMU with vmchannel support
38 - Compiled Linux kernels for 32 and/or 64 bit (see note below).
46 - If you are running a 64 bit or non-x86 machine, see note below.
48 We don't support initramfs at the moment. Patches gratefully
51 Running ./configure will check you have all the requirements installed
56 ----------------------------------------------------------------------
58 Unpack nfs-utils source into a directory somewhere, then create a
59 symlink daemon/nfs-utils to where you unpacked it. For example:
62 tar zxf /path/to/nfs-utils-1.1.4.tar.gz
63 ln -s nfs-utils-1.1.4 nfs-utils
66 For nfs-utils 1.1.4, you may find that the patch
67 (nfs-utils-1.1.4-build.patch) helps.
69 Then make the library and shell tools:
74 Make the daemon and NFS server:
77 ../configure [--disable-nfsv4 --disable-gss]
81 For 64 bit you'll probably want to build the 32 bit daemon and NFS
86 ../configure --enable-32bit [--disable-nfsv4 --disable-gss]
90 For complex cross-architecture environments, you may want to build
91 other versions of the daemon and NFS server as well. See the note
94 Finally run the tests:
98 If everything works, you can install the library and tools by running
99 these commands as root:
106 # Repeat for each daemon/build* directory you made above.
109 Note on 64 bit and non-x86 architectures
110 ----------------------------------------------------------------------
112 The library runs the Linux kernel code in QEMU. It also runs a small
113 control daemon inside QEMU. It might also run an NFS server. It
114 might also run programs from the guest's disk/environment (if asked to).
116 This leaves open the question of which QEMU do we run, eg. qemu (the
117 i386 emulator) or qemu-system-x86_64 or qemu-system-ppc64 or ...?
119 Several factors influence the choice:
121 (a) The host architecture.
123 (b) The guest architecture.
125 (c) What kernel(s) we find at runtime.
127 (d) What compiler(s) we find at configure time.
129 (e) In general, we would prefer to run a 32 bit kernel over a 64 bit
130 kernel, because that reduces the amount of system memory we have to
131 give to qemu significantly, and makes libguestfs smaller, faster and
134 For example, if (a) the host is x86-64, then it might be running a
135 mixture of (b) i386 and x86-64 guests. Disk formats are stable, even
136 across 32 and 64 bit and endianness changes, so it doesn't really
137 matter what kernel we use if we just want to access files in the
138 guest. In the absence of any other factors, we would choose an i386
139 kernel and run it in plain 'qemu', because that would use the least
142 But if we wanted to enable the feature of running a guest program in
143 an x86-64 guest, then we have to run an x86-64 kernel and
144 qemu-system-x86_64 (an i386 kernel can't run 64 bit programs). The
145 same applies if we didn't find a 32 bit kernel at runtime, or if we
146 couldn't run "gcc -m32" at configure time (because we can't compile
149 SO: to enable maximum features on 64 bit architectures:
151 (1) Ensure that "gcc -m32" can create usable binaries.
153 (2) Provide 32 and 64 bit kernels binaries at runtime.
155 If you have a really weird environment, eg. you want to run programs
156 inside PPC64 guests on your MIPS machine, then:
158 (3) Provide gcc cross-compiler and glibc for each architecture, and
159 cross-compile the daemon and NFS server:
161 mkdir daemon/build-ppc64
162 pushd daemon/build-ppc64
163 ../configure --host=ppc64-gnu-linux
168 Copyright and license information
169 ----------------------------------------------------------------------
171 Copyright (C) 2009 Red Hat Inc.
173 The library is distributed under the LGPLv2+. The programs are
174 distributed under the GPLv2+. Please see the files COPYING and
175 COPYING.LIB for full license information.