QEMU-STORAGE-DAEMON(1)
π qemu-storage-daemon(1) β QEMU storage daemon π
okay so bestie, welcome to the manual page for qemu-storage-daemon from QEMU. This is part 1, and we're gonna cover every flag, every path, every warning like it's a group project we actually care about. β¨
πΈ NAME πΈ
qemu-storage-daemon β QEMU storage daemon. That's the whole name, no cap.
π¦ SYNOPSIS π¦
qemu-storage-daemon [options]
π DESCRIPTION π
okay so qemu-storage-daemon gives you disk image functionality from QEMU, qemu-img, and qemu-nbd in a long-running process controlled via QMP commands β and no virtual machine is running. It can export disk images, run block job operations, and perform other disk-related operations. The daemon is controlled via a QMP monitor and initial configuration from the command-line. Literally main character daemon energy. π
The daemon offers this subset of QEMU features, and yes it's a vibe:
- Block nodes
- Block jobs
- Block exports
- Throttle groups
- Character devices
- Crypto and secrets
- QMP
- IOThreads
Commands can be sent over a QEMU Monitor Protocol (QMP) connection. See the qemu-storage-daemon-qmp-ref(7) manual page for a description of the commands.
The daemon runs until it is stopped using the quit QMP command or SIGINT/SIGHUP/SIGTERM.
β οΈ Warning: Never modify images in use by a running virtual machine or any other process; this may destroy the image. Also, be aware that querying an image that is being modified by another process may encounter inconsistent state. No cap, this one is serious. π
β¨ OPTIONS β¨
β Standard options β
-h,--helpβ display help and exit. Your classic "what does this even do" button.-V,--versionβ display version information and exit. Slay, now you know what you're running.-T,--trace [[enable=]PATTERN][,events=FILE][,file=FILE]β specify tracing options. Here's the breakdown, bestie:[enable=]PATTERNβ immediately enable events matching PATTERN (either event name or a globbing pattern). This option is only available if QEMU has been compiled with thesimple,logorftracetracing backend. To specify multiple events or patterns, specify the-traceoption multiple times.
Use -trace help to print a list of names of trace points.
events=FILEβ immediately enable events listed in FILE. The file must contain one event name (as listed in thetrace-events-allfile) per line; globbing patterns are accepted too. This option is only available if QEMU has been compiled with thesimple,logorftracetracing backend.file=FILEβ log output traces to FILE. This option is only available if QEMU has been compiled with thesimpletracing backend.
--blockdev BLOCKDEVDEFβ is a block node definition. See theqemu(1)manual page for a description of block node properties and theqemu-block-drivers(7)manual page for a description of driver-specific parameters.--chardev CHARDEVDEFβ is a character device definition. See theqemu(1)manual page for a description of character device properties. A common character device definition configures a UNIX domain socket:
--chardev socket,id=char1,path=/var/run/qsd-qmp.sock,server=on,wait=off
--exportβ is a block export definition. These are the exact shapes it comes in, so don't freestyle the commas:
--export [type=]nbd,id=<id>,node-name=<node-name>[,name=<export-name>][,writable=on|off][,bitmap=<name>]
--export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,addr.type=unix,addr.path=<socket-path>[,writable=on|off][,logical-block-size=<block-size>][,num-queues=<num-queues>]
--export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,addr.type=fd,addr.str=<fd>[,writable=on|off][,logical-block-size=<block-size>][,num-queues=<num-queues>]
--export [type=]fuse,id=<id>,node-name=<node-name>,mountpoint=<file>[,growable=on|off][,writable=on|off][,allow-other=on|off|auto]
--export [type=]vduse-blk,id=<id>,node-name=<node-name>,name=<vduse-name>[,writable=on|off][,num-queues=<num-queues>][,queue-size=<queue-size>][,logical-block-size=<block-size>][,serial=<serial-number>]
node-name is the block node that should be exported. writable determines whether or not the export allows write requests for modifying data (the default is off).
The nbd export type requires --nbd-server (see below). name is the NBD export name (if not specified, it defaults to the given node-name). bitmap is the name of a dirty bitmap reachable from the block node, so the NBD client can use NBD_OPT_SET_META_CONTEXT with the metadata context name "qemu:dirty-bitmap:BITMAP" to inspect the bitmap.
The vhost-user-blk export type takes a vhost-user socket address on which it accept incoming connections. Both addr.type=unix,addr.path=<socket-path> for UNIX domain sockets and addr.type=fd,addr.str=<fd> for file descriptor passing are supported. logical-block-size sets the logical block size in bytes (the default is 512). num-queues sets the number of virtqueues (the default is 1).
The fuse export type takes a mount point, which must be a regular file, on which to export the given block node. That file will not be changed, it will just appear to have the block node's content while the export is active (very much like mounting a filesystem on a directory does not change what the directory contains, it only shows a different content while the filesystem is mounted). Consequently, applications that have opened the given file before the export became active will continue to see its original content. If growable is set, writes after the end of the exported file will grow the block node to fit. The allow-other option controls whether users other than the user running the process will be allowed to access the export. Note that enabling this option as a non-root user requires enabling the user_allow_other option in the global fuse.conf configuration file. Setting allow-other to auto (the default) will try enabling this option, and on error fall back to disabling it.
The vduse-blk export type takes a name (must be unique across the host) to create the VDUSE device. num-queues sets the number of virtqueues (the default is 1). queue-size sets the virtqueue descriptor table size (the default is 256).
The instantiated VDUSE device must then be added to the vDPA bus using the vdpa(8) command from the iproute2 project:
# vdpa dev add name <id> mgmtdev vduse
The device can be removed from the vDPA bus later as follows:
# vdpa dev del <id>
For more information about attaching vDPA devices to the host with virtio_vdpa.ko or attaching them to guests with vhost_vdpa.ko, see <https://vdpa-dev.gitlab.io/>.
For more information about VDUSE, see <https://docs.kernel.org/userspace-api/vduse.html>.
--monitor MONITORDEFβ is a QMP monitor definition. See theqemu(1)manual page for a description of QMP monitor properties. A common QMP monitor definition configures a monitor on character devicechar1:
--monitor chardev=char1
--nbd-serverβ is a server for NBD exports. The exact shapes are:
--nbd-server addr.type=inet,addr.host=<host>,addr.port=<port>[,tls-creds=<id>][,tls-authz=<id>][,max-connections=<n>]
--nbd-server addr.type=unix,addr.path=<path>[,tls-creds=<id>][,tls-authz=<id>][,max-connections=<n>]
--nbd-server addr.type=fd,addr.str=<fd>[,tls-creds=<id>][,tls-authz=<id>][,max-connections=<n>]
Both TCP and UNIX domain sockets are supported. A listen socket can be provided via file descriptor passing (see Examples below). TLS encryption can be configured using --object tls-creds-* and authz-* secrets (see below).
To configure an NBD server on UNIX domain socket path /var/run/qsd-nbd.sock:
--nbd-server addr.type=unix,addr.path=/var/run/qsd-nbd.sock
--object help,--object <type>,help,--object <type>[,<property>=<value>...]β is a QEMU user creatable object definition. List object types withhelp. List object properties with<type>,help. See theqemu(1)manual page for a description of the object properties.--pidfile PATHβ is the path to a file where the daemon writes its pid. This allows scripts to stop the daemon by sending a signal:
$ kill -SIGTERM $(<path/to/qsd.pid)
A file lock is applied to the file so only one instance of the daemon can run with a given pid file path. The daemon unlinks its pid file when terminating.
The pid file is written after chardevs, exports, and NBD servers have been created but before accepting connections. The daemon has started successfully when the pid file is written and clients may begin connecting.
--daemonizeβ daemonize the process. The parent process will exit once startup is complete (i.e., after the pid file has been or would have been written) or failure occurs. Its exit code reflects whether the child has started up successfully or failed to do so.
π EXAMPLES π
okay bestie this is the fun part β actual copy-paste-able commands, no cap. let's go π
π launching the daemon with a QMP monitor socket
so you want clients to be able to run QMP commands, right? launch the daemon with the QMP monitor socket qmp.sock and you're literally done:
$ qemu-storage-daemon \
--chardev socket,path=qmp.sock,server=on,wait=off,id=char1 \
--monitor chardev=char1
π launching from Python (the fancy fd-passing way)
now THIS one is iconic. launch the daemon from Python with a QMP monitor socket using file descriptor passing, so you don't have to busy wait for the QMP monitor to become available. main character energy fr fr:
#!/usr/bin/env python3
import subprocess
import socket
sock_path = '/var/run/qmp.sock'
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as listen_sock:
listen_sock.bind(sock_path)
listen_sock.listen()
fd = listen_sock.fileno()
subprocess.Popen(
['qemu-storage-daemon',
'--chardev', f'socket,fd={fd},server=on,id=char1',
'--monitor', 'chardev=char1'],
pass_fds=[fd],
)
# listen_sock was automatically closed when leaving the 'with' statement
# body. If the daemon process terminated early then the following connect()
# will fail with "Connection refused" because no process has the listen
# socket open anymore. Launch errors can be detected this way.
qmp_sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
qmp_sock.connect(sock_path)
...QMP interaction...
bestie notice that comment block? π that's not filler β if the daemon dies early, yourconnect()blows up with"Connection refused"because nobody's holding the listen socket open anymore. free launch-error detection, we love to see it π
π¦ the same trick, other sockets
the same socket spawning approach also works with the --nbd-server addr.type=fd,addr.str=<fd> and --export type=vhost-user-blk,addr.type=fd,addr.str=<fd> options. same vibe, different address type π«Ά
πΎ export a raw image over NBD
export the raw image file disk.img over the NBD UNIX domain socket nbd.sock:
$ qemu-storage-daemon \
--blockdev driver=file,node-name=disk,filename=disk.img \
--nbd-server addr.type=unix,addr.path=nbd.sock \
--export type=nbd,id=export,node-name=disk,writable=on
slay. one file, one socket, done β¨
π₯ export a qcow2 image as vhost-user-blk
export a qcow2 image file disk.qcow2 as a vhost-user-blk device over the UNIX domain socket vhost-user-blk.sock:
$ qemu-storage-daemon \
--blockdev driver=file,node-name=file,filename=disk.qcow2 \
--blockdev driver=qcow2,node-name=qcow2,file=file \
--export type=vhost-user-blk,id=export,addr.type=unix,addr.path=vhost-user-blk.sock,node-name=qcow2
two --blockdevs stacked like a little sandwich: the file node feeds the qcow2 node, and the qcow2 node gets exported. chef's kiss π§
π export a qcow2 image via FUSE (on itself!)
this one is highkey my favourite. export a qcow2 image file disk.qcow2 via FUSE on itself, so the disk image file will then appear as a raw image:
$ qemu-storage-daemon \
--blockdev driver=file,node-name=file,filename=disk.qcow2 \
--blockdev driver=qcow2,node-name=qcow2,file=file \
--export type=fuse,id=export,node-name=qcow2,mountpoint=disk.qcow2,writable=on
yes bestie, the mountpoint is literally the same filename. it's giving "i contain multitudes" π the qcow2 becomes a raw image, right there on itself. obsessed.
π SEE ALSO π
go read those too, iykyk β they're the supporting cast and they ate π
π Copyright π
2026, The QEMU Project Developers
aaaand that's a wrap bestie π this page ships with QEMU version 11.1.3, dated Oct 29, 2026, and it's the QEMU-STORAGE-DAEMON(1) manual. go forth and daemon-ify, you've got this πβ¨π¦
π¦ where this page comes from
- arch rolling: qemu-img 11.1.3-1 Β· BSD-2-Clause AND BSD-2-Clause-Patent AND BSD-3-Clause AND CC0-1.0 AND FSFAP AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Linux-syscall-note AND GPL-2.0-only WITH Linux-syscall-note OR BSD-2-Clause AND GPL-2.0-only WITH Linux-syscall-note OR BSD-3-Clause AND GPL-2.0-or-later AND GPL-2.0-or-later OR BSD-3-Clause AND GPL-2.0-or-later WITH Linux-syscall-note AND ISC AND LGPL-2.1-only OR BSD-3-Clause AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Public-Domain AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms