VIRTNBDBACKUP(1)

πŸ’– NAME πŸ’–

virtnbdbackup β€” the backup utility for libvirt, and honestly? she's that girl. πŸ’…


✨ DESCRIPTION ✨

Okay bestie, gather round, because this is the whole entire vibe. Here's how you call her:

usage: virtnbdbackup [-h] -d DOMAIN [-l {copy,full,inc,diff,auto}]

[-t {stream,raw}] [-r] -o OUTPUT [-C CHECKPOINTDIR]
       [--scratchdir SCRATCHDIR] [-S] [--pause] [-i INCLUDE] [-x
       EXCLUDE] [-f SOCKETFILE] [-n] [-z [COMPRESS]] [-w WORKER] [-F
       FREEZE_MOUNTPOINT] [-e] [--no-sparse-detection] [-T THRESHOLD]
       [-U URI] [--user USER] [--ssh-user SSH_USER] [--ssh-port
       SSH_PORT] [--ssh-private-key SSH_PRIVATE_KEY] [--password
       PASSWORD] [-P NBD_PORT] [-I NBD_IP] [--tls] [--tls-cert TLS_CERT]
       [-L] [--quiet] [--nocolor] [-q] [-s] [-k] [-p] [-v] [-V]

Long story short: Backup libvirt/qemu virtual machines. That's the whole job. She ate and left no crumbs. πŸ“


πŸŽ€ options πŸŽ€

  • -h, --help β€” prints this help message and dips. iconic behavior tbh. ✨

πŸ’… General options πŸ’…

  • -d, --domain DOMAIN β€” the domain you wanna backup. your main character. πŸ‘‘
  • -l, --level {copy,full,inc,diff,auto} β€” the backup level. (default: copy)
  • -t, --type {stream,raw} β€” what kind of output you want: stream or raw. (default: stream)
  • -r, --raw β€” throw the full provisioned disk images into the backup too. (default: False)
  • -o, --output OUTPUT β€” the output target directory. where the goods go. 🎁
  • -C, --checkpointdir CHECKPOINTDIR β€” the persistent libvirt checkpoint storage directory.
  • --scratchdir SCRATCHDIR β€” where the temporary scratch file lives. (default: /var/tmp)
  • -S, --start-domain β€” if the VM is offline, start it up. (default: False)
  • --pause β€” freeze-frame the VM while the backup job starts. (default: False)
  • -i, --include INCLUDE β€” back up only the disk with this target dev name (like -i vda).
  • -x, --exclude EXCLUDE β€” skip disk(s) by target dev name (like -x vda,vdb). not invited to the party. πŸ™ˆ
  • -f, --socketfile SOCKETFILE β€” use this file for the NBD Server socket (default: /var/tmp/virtnbdbackup.685309).
  • -n, --noprogress β€” kill the progress bar. no thoughts, just silence.
  • -z, --compress [COMPRESS] β€” compress with lz4 compression level. (default: False)
  • -w, --worker WORKER β€” how many concurrent workers back up multiple disks at once. (default: amount of disks)
  • -F, --freeze-mountpoint FREEZE_MOUNTPOINT β€” if the qemu agent is available, only freeze the filesystems on these mountpoints inside the VM (default: all).
  • -e, --strict β€” flips the exit code if warnings pop up during the backup. (default: False)
  • --no-sparse-detection β€” skips detecting sparse ranges during incremental or differential backup. (default: False)
  • -T, --threshold THRESHOLD β€” only run the backup if the threshold is actually reached. no fake-outs. 🚫

🌈 Remote Backup options 🌈

  • -U, --uri URI β€” the libvirt connection URI. (default: qemu:///session)
  • --user USER β€” user to authenticate against libvirtd. (default: None)
  • --ssh-user SSH_USER β€” user to authenticate against the remote sshd: used for the remote copy of files. (default: abi)
  • --ssh-port SSH_PORT β€” port to connect to the remote sshd: used for the remote copy of files. (default: 22)
  • --ssh-private-key SSH_PRIVATE_KEY β€” path to the private key file for SSH auth (same energy as ssh -i). (default: None)
  • --password PASSWORD β€” password to authenticate against libvirtd. (default: None)
  • -P, --nbd-port NBD_PORT β€” the port the remote NBD Service uses. should be unique for every backup you start. (default: 10809)
  • -I, --nbd-ip NBD_IP β€” the IP to bind the remote NBD service on (default: hostname returned by libvirtd).
  • --tls β€” enable and use TLS for the NBD connection. (default: False)
  • --tls-cert TLS_CERT β€” path to the TLS certificates used during offline backup and restore. (default: /etc/pki/qemu/)

πŸŒ™ Logging options πŸŒ™

  • -L, --syslog β€” also send log messages to syslog. (default: False)
  • --quiet β€” stop logging to stderr. (default: False)
  • --nocolor β€” no colored output. (default: False)

πŸ› Debug options πŸ›

  • -q, --qemu β€” use Qemu tools to query extents.
  • -s, --startonly β€” only initialize the backup job via libvirt, don't actually back up any data.
  • -k, --killonly β€” kill any running block job. πŸ’€
  • -p, --printonly β€” quit right after printing the estimated checkpoint size.
  • -v, --verbose β€” turn on debug output.
  • -V, --version β€” show the version and exit.

🧁 EXAMPLES 🧁

bestie, here's the playbook. copy-paste with confidence. 🫢

# full backup of domain 'webvm' with all attached disks:

virtnbdbackup -d webvm -l full -o /backup/

# incremental backup:

virtnbdbackup -d webvm -l inc -o /backup/

# differential backup:

virtnbdbackup -d webvm -l diff -o /backup/

# full backup, exclude disk 'vda':

virtnbdbackup -d webvm -l full -x vda -o /backup/

# full backup, backup only disk 'vdb':

virtnbdbackup -d webvm -l full -i vdb -o /backup/

# full backup, compression enabled:

virtnbdbackup -d webvm -l full -z -o /backup/

# full backup, create archive:

virtnbdbackup -d webvm -l full -o - > backup.zip

# full backup of vm operating on remote libvirtd:

virtnbdbackup -U qemu+ssh://root@remotehost/system --ssh-user
root -d webvm -l full -o /backup/

lowkey a reminder, highkey important: the remote one above wraps onto a second line in the original, so root -d webvm -l full -o /backup/ is the continuation of that same command. keep it together, don't let it get separated. πŸ’œ

and that's the whole page, bestie!! you're now officially fluent in virtnbdbackup. iykyk. πŸŒΈπŸ¦‹βœ¨

slay, go back up those VMs. πŸ’–

okay but for real, the credits: this was virtnbdbackup 2.49, dated July 2026, and the manual page is VIRTNBDBACKUP(1). periodt. πŸ‘‘

πŸ“¦ where this page comes from