OS Manuals

/usr/bin/qemu-nbd

QEMU utils

From qemu-utils 11.1.3-r1 (os), captured 2026-11-05 by running qemu-nbd --help (exit 0). permalink

Also provided by 1 other package version
Usage: /usr/bin/qemu-nbd [OPTIONS] FILE
  or:  /usr/bin/qemu-nbd -L [OPTIONS]
QEMU Disk Network Block Device Utility

  -h, --help                display this help and exit
  -V, --version             output version information and exit

Connection properties:
  -p, --port=PORT           port to listen on (default `10809')
  -b, --bind=IFACE          interface to bind to (default `0.0.0.0')
  -k, --socket=PATH         path to the unix socket
                            (default '/var/lock/qemu-nbd-DEVICE')
  -e, --shared=NUM          device can be shared by NUM clients (default '1')
  -t, --persistent          don't exit on the last connection
  -v, --verbose             display extra debugging information
  -x, --export-name=NAME    expose export by name (default is empty string)
  -D, --description=TEXT    export a human-readable description
      --handshake-limit=N   limit client's handshake to N seconds (default 10)

Exposing part of the image:
  -o, --offset=OFFSET       offset into the image
  -A, --allocation-depth    expose the allocation depth
  -B, --bitmap=NAME         expose a persistent dirty bitmap

General purpose options:
  -L, --list                list exports available from another NBD server
  --object type,id=ID,...   define an object such as 'secret' for providing
                            passwords and/or encryption keys
  --tls-creds=ID            use id of an earlier --object to provide TLS
  --tls-authz=ID            use id of an earlier --object to provide
                            authorization
  --tls-hostname=HOSTNAME   override hostname used to check x509 certificate
  -T, --trace [[enable=]<pattern>][,events=<file>][,file=<file>]
                            specify tracing options
  --fork                    fork off the server process and exit the parent
                            once the server is running
  --pid-file=PATH           store the server's process ID in the given file
  --selinux-label=LABEL     set SELinux process label on listening socket

Kernel NBD client support:
  -c, --connect=DEV         connect FILE to the local NBD device DEV
  -d, --disconnect          disconnect the specified device

Block device options:
  -f, --format=FORMAT       set image format (raw, qcow2, ...)
  -r, --read-only           export read-only
  -s, --snapshot            use FILE as an external snapshot, create a temporary
                            file with backing_file=FILE, redirect the write to
                            the temporary one
  -l, --load-snapshot=SNAPSHOT_PARAM
                            load an internal snapshot inside FILE and export it
                            as an read-only device, SNAPSHOT_PARAM format is
                            'snapshot.id=[ID],snapshot.name=[NAME]', or
                            '[ID_OR_NAME]'
  -n, --nocache             disable host cache
      --cache=MODE          set cache mode used to access the disk image, the
                            valid options are: 'none', 'writeback' (default),
                            'writethrough', 'directsync' and 'unsafe'
      --aio=MODE            set AIO mode (native, io_uring or threads)
      --discard=MODE        set discard mode (ignore, unmap)
      --detect-zeroes=MODE  set detect-zeroes mode (off, on, unmap)
      --image-opts          treat FILE as a full set of image options

See <https://qemu.org/contribute/report-a-bug> for how to report bugs.
More information on the QEMU project at <https://qemu.org>.
Options (35)
OptionDescriptionSource
-h, --helpDisplay this help and exit.help + man
-V, --versionDisplay version information and exit.help + man
-p, --port PORTTCP port to listen on as a server, or connect to as a client (default 10809).help + man
-b, --bind IFACEThe interface to bind to as a server, or connect to as a client (default 0.0.0.0).help + man
-k, --socket PATHpath to the unix socket (default '/var/lock/qemu-nbd-DEVICE')help + man
-e, --shared NUMAllow up to NUM clients to share the device (default 1), 0 for unlimited.help + man
-t, --persistentDon't exit on the last connection.help + man
-v, --verboseDisplay extra debugging information.help + man
-x, --export-name NAMESet the NBD volume export name (default of a zero-length string).help + man
-D, --description TEXTSet the NBD volume export description, as a human-readable string.help + man
--handshake-limit NSet the timeout for a client to successfully complete its handshake to N seconds (default 10), or 0 for no limit.help + man
-o, --offset OFFSETThe offset into the image.help + man
-A, --allocation-depthExpose allocation depth information via the qemu:allocation-depth metadata context accessible through NBD_OPT_SET_META_CONTEXT.help + man
-B, --bitmap NAMEIf filename has a qcow2 persistent bitmap NAME, expose that bitmap via the qemu:dirty-bitmap:NAME metadata context accessible through NBD_OPT_SET_META_CONTEXT.help + man
-L, --listConnect as a client and list all details about the exports exposed by a remote NBD server.help + man
--object typedefine an object such as 'secret' for providing passwords and/or encryption keyshelp + man
--tls-creds IDEnable mandatory TLS encryption for the server by setting the ID of the TLS credentials object previously created with the --object option;help + man
--tls-authz IDSpecify the ID of a qauthz object previously created with the --object option.help + man
--tls-hostname HOSTNAMEWhen validating an x509 certificate received over a TLS connection, the hostname that the NBD client used to connect will be checked against information in the server provided certificate.help + man
-T, --trace enable=]<patternspecify tracing optionshelp
--forkFork off the server process and exit the parent once the server is running.help + man
--pid-file PATHStore the server's process ID in the given file.help + man
--selinux-label LABELset SELinux process label on listening sockethelp
-c, --connect DEVConnect filename to NBD device DEV (Linux only).help + man
-d, --disconnectDisconnect the device DEV (Linux only).help + man
-f, --format FORMATForce the use of the block driver for format FMT instead of auto-detecting.help + man
-r, --read-onlyExport the disk as read-only.help + man
-s, --snapshotUse filename as an external snapshot, create a temporary file with backing_file=filename, redirect the write to the temporary one.help + man
-l, --load-snapshot SNAPSHOT_PARAMload an internal snapshot inside FILE and export it as an read-only device, SNAPSHOT_PARAM format is 'snapshot.id=[ID],snapshot.name=[NAME]', or '[ID_OR_NAME]'help + man
-n, --nocacheEquivalent to --cache=none.help + man
--cache MODEset cache mode used to access the disk image, the valid options are: 'none', 'writeback' (default), 'writethrough', 'directsync' and 'unsafe'help + man
--aio MODESet the asynchronous I/O mode between threads (the default), native (Linux only), and io_uring (Linux 5.1+).help + man
--discard MODEControl whether discard (also known as trim or unmap) requests are ignored or passed to the filesystem.help + man
--detect-zeroes MODEControl the automatic conversion of plain zero writes by the OS to driver-specific optimized zero write commands.help + man
--image-optsTreat filename as a set of image options, instead of a plain filename.help + man
Examples (5) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.