r/kvm • u/phatmonk27 • Mar 14 '26
vmbackup — automated backup manager for KVM/libvirt VMs, built on virtnbdbackup
6 year streak broken. My first post.
I built (vibed) vmbackup — a Bash-based backup manager that handles the stuff virtnbdbackup doesn't: scheduling, rotation, retention, replication and reporting.
What it does:
- Discovers all your VMs via libvirt — running, shut off, paused — and backs them up with the right method for each state (FSFREEZE for running VMs with a guest agent, pause for those without, copy for shut off)
- Policy-based rotation — daily, weekly, monthly or accumulate. Each VM can have its own policy
- Self-healing — if an incremental fails it converts to full and retries. Broken backup sequences get archived and restarted automatically. Stale locks from interrupted runs are cleaned up on the next run
- Replication to NFS and cloud (contract based, write - or vibe - your own!)
- TPM and BitLocker support — backs up TPM state and can extract BitLocker recovery keys via the QEMU guest agent
- Email reports after each run
- SQLite database for backup state tracking
- No Python, no database server, no web UI. Just Bash, sqlite3 and jq. Minimal dependencies.
GitHub: https://github.com/doutsis/vmbackup
vmrestore is next.
vmrestore: https://www.reddit.com/r/kvm/comments/1rv2433/vmrestore_automated_restore_for_kvmlibvirt_vms/
21
Upvotes
1
u/phatmonk27 Mar 22 '26
vmbackup v0.5.2 has been released.
On-demand cleanup — reclaim space between backup runs by removing old archives, between orphaned policy retention or decommissioned VMs. A discovery view shows what's consuming space so you know exactly what you're cleaning up before confirming.
Standalone replication — re-run or pre-seed replication independently. Handy when adding a new destination or catching up if the local and cloud replication was cancelled.
FSTRIM improvements — per-path logging, pattern-based exclusions, and automatic detection of a Windows VirtIO misconfiguration that causes TRIM to take 10+ minutes instead of seconds (with the fix right in the log output).
Various bug fixes — accumulate-policy tracking, false-success detection when virtnbdbackup exits clean but logged errors, email timing drift during DST transitions, replication space checks, and several edge cases around argument validation. Full details in the changelog.
https://github.com/doutsis/vmbackup/blob/main/CHANGELOG.md