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,--domainDOMAIN β 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:streamorraw. (default:stream)-r,--rawβ throw the full provisioned disk images into the backup too. (default:False)-o,--outputOUTPUT β the output target directory. where the goods go. π-C,--checkpointdirCHECKPOINTDIR β the persistentlibvirtcheckpoint storage directory.--scratchdirSCRATCHDIR β 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,--includeINCLUDE β back up only the disk with this target dev name (like-i vda).-x,--excludeEXCLUDE β skip disk(s) by target dev name (like-x vda,vdb). not invited to the party. π-f,--socketfileSOCKETFILE β 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 withlz4compression level. (default:False)-w,--workerWORKER β how many concurrent workers back up multiple disks at once. (default: amount of disks)-F,--freeze-mountpointFREEZE_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,--thresholdTHRESHOLD β only run the backup if the threshold is actually reached. no fake-outs. π«
π Remote Backup options π
-U,--uriURI β thelibvirtconnection URI. (default:qemu:///session)--userUSER β user to authenticate againstlibvirtd. (default:None)--ssh-userSSH_USER β user to authenticate against the remotesshd: used for the remote copy of files. (default:abi)--ssh-portSSH_PORT β port to connect to the remotesshd: used for the remote copy of files. (default:22)--ssh-private-keySSH_PRIVATE_KEY β path to the private key file for SSH auth (same energy asssh -i). (default:None)--passwordPASSWORD β password to authenticate againstlibvirtd. (default:None)-P,--nbd-portNBD_PORT β the port the remote NBD Service uses. should be unique for every backup you start. (default:10809)-I,--nbd-ipNBD_IP β the IP to bind the remote NBD service on (default: hostname returned bylibvirtd).--tlsβ enable and use TLS for the NBD connection. (default:False)--tls-certTLS_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 vialibvirt, 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
- ubuntu stonking: virtnbdbackup 2.49-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms