docs: Move release notes to their own section.
[nbdkit/ericb.git] / README
blob9752e0bf14d6bd4c10405c9e2022a7e8d44235e2
1 NBD — Network Block Device — is a protocol for accessing Block Devices
2 (hard disks and disk-like things) over a Network.
4 nbdkit is a toolkit for creating NBD servers.
6 The key features are:
8  * Multithreaded NBD server written in C with good performance.
10  * Minimal dependencies for the basic server.
12  * Liberal license (BSD) allows nbdkit to be linked to proprietary
13    libraries or included in proprietary code.
15  * Well-documented, simple plugin API with a stable ABI guarantee.
16    Lets you export “unconventional” block devices easily.
18  * You can write plugins in C, Lua, Perl, Python, OCaml, Ruby, Rust,
19    shell script or Tcl.
21  * Filters can be stacked in front of plugins to transform the output.
23 For documentation, see the ‘docs/’ directory.
25 For plugins, examples and filters, see the ‘plugins/’ and ‘filters/’
26 directories.
28 LICENSE
29 =======
31 This software is copyright (C) Red Hat Inc. and licensed under a BSD
32 license.  See ‘LICENSE’ for details.
34 BUILDING FROM SOURCE
35 ====================
37 Requirements
38 ------------
40 To build the basic server and some plugins nbdkit needs nothing except
41 Linux, FreeBSD or OpenBSD, and:
43  - GCC or Clang
45  - bash
47  - GNU make
49 Although it is possible to build without it, it’s recommended to
50 enable TLS (authentication and encryption) support for which you will
51 need:
53  - gnutls >= 3.3.0
55 Optional dependencies
56 ---------------------
58 To build the man pages, you will optionally need to install:
60  - Perl
62  - Pod::Man and Pod::Simple (Perl library)
64 For SELinux socket labelling support:
66  - libselinux
68 For the gzip plugin:
70  - zlib
72 For the xz filter:
74  - liblzma
76 For the curl (HTTP/FTP) plugin:
78  - libcurl
80 For the ssh plugin:
82  - libssh >= 0.8.0
83    (this is a different library from libssh2 - that will not work)
85 For the iso plugin:
87  - genisoimage or mkisofs
89 For the floppy plugin:
91  - iconv (on Linux this is built into glibc, on other systems
92    it may be a separate library)
94 For the libvirt plugin:
96  - libvirt
98 For the libguestfs plugin, and to run parts of the test suite:
100  - libguestfs
102  - guestfish (from libguestfs)
104 For the ext2 plugin:
106  - ext2fs
108  - com_err
110 For the linuxdisk plugin:
112  - mke2fs >= 1.42.10 (from e2fsprogs)
114 For the nbd plugin, to get URI and TLS support:
116  - libnbd >= 0.9.8
118 For the Perl, example4 and tar plugins:
120  - perl interpreter
122  - perl development libraries
124  - perl module ExtUtils::Embed
126 For the Python plugin:
128  - python interpreter (version 3 only)
130  - python development libraries
132 For the OCaml plugin:
134  - OCaml >= 4.02.2
136 For the Tcl plugin:
138  - Tcl development library and headers
140 For the Lua plugin:
142  - Lua development library and headers
144 For the Rust plugin:
146  - cargo (other dependencies will be downloaded at build time)
148 For bash tab completion:
150  - bash-completion >= 1.99
152 To test for memory leaks (‘make check-valgrind’):
154  - valgrind program and development headers
156 For non-essential enhancements to the test suite:
158  - ip, ss (from iproute package)
160  - jq
162  - losetup (from util-linux package)
164  - mke2fs (from e2fsprogs)
166  - nbdsh (from libnbd)
168  - qemu-img, qemu-io, qemu-nbd (usually shipped with qemu)
170  - sfdisk (from util-linux)
172  - socat
174  - ssh-keygen
176  - stat (from coreutils)
178 Building
179 --------
181     To build from tarball:         To build from git:
182     ----------------------         ------------------
183                                    autoreconf -i
184     ./configure                    ./configure
185     make                           make
186     make check                     make check
188 To run nbdkit from the source directory, use the top level ./nbdkit
189 wrapper.  It will run nbdkit and plugins from the locally compiled
190 directory:
192     $ ./nbdkit example1 -f -v
193     ./server/nbdkit ./plugins/example1/.libs/nbdkit-example1-plugin.so -f -v
194     [etc]
196 Optionally run this command as root to install everything:
198     make install
200 Python
201 ------
203 Since nbdkit >= 1.16, only Python >= 3.3 is supported.
205 By default nbdkit uses the Python version of the Python interpreter
206 called “python” on the current $PATH.  If you have parallel versions
207 of Python installed then you can choose a different version by setting
208 the PYTHON variable when configuring.  For example:
210     ./configure PYTHON=/usr/bin/python3.8
212 Running the tests
213 -----------------
215 You will need to install libguestfs to run most of the test suite:
217     make check
219 The test suite is fairly comprehensive.  It runs the newly built
220 nbdkit + plugins as a captive process, and tests them using
221 libguestfs.  If there is a failure, look at the corresponding
222 ‘tests/*.log’ file for debug information.
224 A few tests require root privileges, and are skipped by default.  To
225 run them you must do:
227     sudo make check-root
229 If you have the proprietary VDDK library, you can test
230 nbdkit-vddk-plugin against the library like this:
232     make check-vddk vddkdir=vmware-vix-disklib-distrib
234 DOWNLOAD TARBALLS
235 =================
237 Tarballs are available from:
238 http://libguestfs.org/download/nbdkit
240 DEVELOPERS
241 ==========
243 Install the valgrind program and development headers.
245 Use:
247     ./configure --enable-gcc-warnings --enable-valgrind
249 When testing use:
251     make check
252     make check-valgrind
254 For development ideas, see the TODO file.
256 The upstream git repository is:
257 https://github.com/libguestfs/nbdkit
259 Please send patches to the libguestfs mailing list:
260 https://www.redhat.com/mailman/listinfo/libguestfs
262 For further information, see:
263 http://libguestfs.org/
264 https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md