There are three common ways to protect virtual machines on KVM platforms such as Proxmox VE, oVirt, OLVM and RHV:
- Agent based backup. A backup agent runs inside every VM and copies data on a schedule.
- CDP with an agent in the guest. A filter driver inside every VM captures each write and streams it to a journal.
- CDP on the host. A lightweight agent on each hypervisor host tracks writes below the guest, so nothing is installed inside the VMs. From the VM's point of view it is agentless.
All three can protect your data. They differ in what they cost you to run, how much data you can lose, and how fast you get back. This post walks through each one honestly, including where the agent approaches still win.
1. Agent based backup inside the VM
This is the classic model. Each VM runs an agent that reads files or volumes and sends them to a backup server on a schedule, often nightly.
Where it hurts:
- Recovery point is measured in hours. Anything written between two runs is lost. A nightly job means up to a day of data is at risk.
- One agent per VM to install, patch and monitor. With hundreds of VMs, keeping every agent on a supported version becomes its own job. A VM that was never enrolled is simply unprotected, and nobody notices until it matters.
- Load lands inside the workload. The agent reads data using the guest's own CPU, memory and disk. Backup windows exist precisely because this slows production down.
- Every guest OS needs its own agent. Linux distributions, Windows versions and appliances each need a supported build. Appliances you cannot install software on are often left out.
- Recovery is a restore, not a failover. Getting a whole VM back usually means creating a new VM and restoring data into it, which takes time proportional to its size.
Where it is still good: agents understand files and applications. They can trigger application aware snapshots, back up a database properly and restore a single file easily. For long term retention and archiving, scheduled backup remains a sensible tool.
2. CDP with an agent inside the VM
This model keeps the agent but changes what it does. A filter driver in the guest kernel sees every block written and streams it to a journal, so the recovery point drops to seconds.
Where it hurts:
- A kernel driver in every guest. The driver sits in the write path of the guest's storage stack. A bug there does not just break backups: it can slow down or crash the production VM.
- Kernel updates become a risk. Drivers are tied to kernel versions. A routine OS update can leave the driver unable to load, and protection stops silently until someone rebuilds or upgrades it.
- Per OS support again. Each kernel and OS version needs a tested driver. Older or unusual guests often fall outside the support list.
- Overhead on every write. Capturing and shipping each write inside the guest costs CPU, memory and network inside the VM, at all times rather than only during a backup window.
- Security surface in every VM. Each guest now runs privileged code with network access to the protection system. That is one more thing to harden, patch and audit per VM.
Where it is still good: if you have no access to the hypervisor, a guest agent is the only way to get CDP. That covers physical servers, some public cloud instances, and machines that protect themselves. We open sourced a device mapper target, dm-cdp, exactly for that kind of case.
3. CDP with an agent on the host
Here the agent moves out of the VMs and onto the hypervisor host. On KVM, QEMU keeps a dirty bitmap of the blocks each disk has written. A lightweight host agent reads only those changed blocks, sends them to the DR site at short intervals, and the system keeps a journal of recovery points. Nothing is installed in the guests.
Why it helps:
- Recovery point of seconds to minutes, the same class as an in guest CDP agent.
- One agent per host, not one per VM. A host running 30 VMs needs one agent, not 30. A new VM is protected by adding it to a group, not by logging into it, and kernel updates inside the guest cannot break protection.
- Any guest OS. Linux, Windows and appliances are protected the same way, because the hypervisor only sees blocks.
- No load inside the workload. Tracking happens in QEMU and the host agent. The guest does not spend its own CPU or memory on protection.
- Consistency across disks and VMs. Bitmaps for related disks can be marked in one atomic step, so a multi disk or multi VM application gets crash consistent recovery points as a group.
- Recovery is a boot, not a restore. The replica already exists at the DR site, so failover means starting the VM there, rather than rebuilding it from a backup.
Its trade offs, honestly:
- Crash consistency by default. Without help from inside the guest, a recovery point looks like a sudden power cut. Modern file systems and databases recover from that cleanly, but if you need application consistent points, you still need a guest tool such as the QEMU guest agent to freeze the file system at the right moment.
- No file level awareness on its own. The hypervisor sees blocks, not files. File restore works by mounting a recovery point and browsing it, rather than by asking an agent for a file.
- Needs access to the hypervisor. It only works where you run the hosts. It is not an option on platforms where you only get a VM.
What recovery looks like

With a backup agent, recovery means building a new VM and restoring every byte into it, so the time grows with the size of the VM. A CDP agent in the guest shortens the recovery point, but getting the VM back still depends on rebuilding it or on the driver loading cleanly at boot. With CDP on the host, the replica already exists at the DR site, so recovery is a VM boot.
Recovery point and recovery time

These are typical ranges, not promises. Real numbers depend on data size, network bandwidth and how fast the workload writes.
Ransomware: detection and recovery

Ransomware changes the question from "can I restore?" to "can I restore to a point the attacker never touched, and how fast?"
Backup agent in the VM. The agent runs inside the operating system the attacker now controls, and backup systems are a well known target. Even when the backups survive, the best you can do is return to the last good backup, which can be hours old, and then restore every VM one by one. Detection usually happens after the fact, when users notice or the next job fails.
CDP agent in the VM. The journal lets you go back to seconds before encryption started, which is a big improvement. But the driver also lives inside the compromised guest. An attacker with administrator rights can stop it, unload it or tamper with what it sends, and you may not know until you need it.
CDP agent on the host. Protection runs below the guest, so malware inside the VM cannot see it, stop it or delete its journal. Because every write passes through the host, a sudden burst of encrypted rewrites stands out at block level, which allows earlier detection. Recovery means picking a point seconds before the attack, checking it in an isolated Simulation, and booting it at the DR site in minutes.
The host itself still has to be protected: separate credentials for the hypervisors and the replication target, and immutable copies, keep the recovery points out of an attacker's reach.
Side by side
| Agent backup in the VM | CDP agent in the VM | CDP agent on the host | |
|---|---|---|---|
| Recovery point | Hours | Seconds | Seconds to minutes |
| Where the agent runs | In every VM | In every VM (kernel driver) | Once per host, none in the VMs |
| Breaks on guest kernel updates | Sometimes | Yes, it is the main risk | No |
| Load on the workload | During backup windows | On every write | None in the guest |
| Guest OS coverage | Per supported OS | Per supported kernel | Any OS the hypervisor runs |
| Consistency across VMs | Per VM | Per VM | Group consistent |
| Getting a VM back | Restore into a new VM | Restore or failover | Boot the replica |
| Typical recovery time | Hours, grows with size | Minutes to hours | Minutes |
| Malware in the VM can disable it | Yes | Yes | No |
| Ransomware recovery point | Last good backup | Seconds before the attack | Seconds before the attack |
| Application aware | Yes | Sometimes | With a guest freeze tool |
| Needs hypervisor access | No | No | Yes |
Which one should you use?
If you control the hypervisors, CDP on the host removes the biggest operational burden of the other two: software in every guest that has to be installed, patched and kept compatible with every kernel update. You maintain one agent per host instead of one per VM, and you get a recovery point of seconds without paying for it inside each VM.
Agent based backup still has a place for long term retention and single file restores. A CDP agent in the guest still has a place where the hypervisor is out of reach.
For VMs running on hosts you own, protect them from the hypervisor.
About the author
- KVMDR builds near sync disaster recovery and continuous data protection for KVM: Proxmox VE, oVirt, OLVM and RHV. We write about changed block tracking, replication, failover and recovering from ransomware. Free homelab licence at kvmdr.ai/community.
Comments
Join the discussionNo comments yet. Be the first to comment.


