When running Windows VMs on Proxmox and you want to make snapshot backups you really want to run the qemu-agent inside the Windows VMs.
First of all you really want snapshot
mode backups as of all backup modes they have the least downtime. By default they have a small inconsistency risk, but on Windows that can be alleviated by running qemu-agent as described in [WayBack] Backup and Restore – Proxmox VE: Backup Modes
More on snapshot
backup mode
Backup modes for VMs:
- snapshot mode
- This mode provides the lowest operation downtime, at the cost of a small inconstancy risk. It works by performing a Proxmox VE live backup, in which data blocks are copied while the VM is running. If the guest agent is enabled (agent: 1) and running, it calls guest-fsfreeze-freeze and guest-fsfreeze-thaw to improve consistency.
A technical overview of the Proxmox VE live backup for QemuServer can be found online here (https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt -> https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=vma_spec.txt;).
|
Proxmox VE live backup provides snapshot-like semantics on any storage type. It does not require that the underlying storage supports snapshots. |
On Windows the trick is that qemu-agent can use VSS to get a frozen state of the filesystem as described in [WayBack] Qemu-guest-agent – Proxmox VE:
In Proxmox VE, the qemu-guest-agent is used for mainly two things:
- To properly shutdown the guest, instead of relying on ACPI commands or windows policies
- To freeze the guest file system when making a backup (on windows, use the volume shadow copy service VSS).
So: installing qemu-agent.

Start with the VM options
Don’t make the mistake to start at [WayBack] Qemu-guest-agent – Proxmox VE: Installation; guest; Windows as it will give you a hard time. Always use the full [WayBack] Qemu-guest-agent Installation steps beginning at the[WayBack] Host; these steps worked for me:
- Download a recent set of [WayBack] Windows VirtIO Drivers – Proxmox VE
- Ensure the ISO image is in
/var/lib/vz/template/iso
on the Proxmox host so they show up as local:iso for mounting.
- Shutdown the Windows VM
- [WayBack] Qemu-guest-agent – Proxmox VE: Host; enable guest for VM: on the “Options” page for a VM, ensure the “Qemu Agent” setting is set to “yes”
- This will add a PCI serial device to your computer that Windows – after a fresh boot – sees as “PCI Simple Communications Controller”
- Mount the ISO image to a CD/DVD drive

- Boot the Windows VM
- Start Device Manager (
devmgmt.msc
)
- In the Device Manager, observe a new device “PCI Simple Communications Controller” that doesn’t have drivers installed yet

- Right click the”PCI Simple Communications Controller” device and select “Update Driver Software…”

- Indicate you want to browser for the files (as opposed of Windows finding them on-line: they’re not on-line):

- On the CD/DVD drive letter you mounted the ISO image to, select
D:\vioserial\[OS-Version]\
where OS-Version
is your Windows Version and ensure “Include subfolder” has a checkmark so it will find the Win32 or Win64 drivers depending on your processor architecture.
- I used
D:\vioserial\w7
- Finish the driver installation

- Observe it now has a driver installed


- From
D:\guest-agent
install either qemu-ga-x64.msi
for Win64 or qemu-ga-x86.msi
for Win32.
- During installation, confirm the UAC prompt for sofware by
Red Hat, Inc.
: 
- Start the Service Manager (
services.msc
) and execute from any command promt the following statments to verify the check if these services are running: 
- Now reboot the VM, logon and start the Service Manager again; now it should look like this

Note you can obtain the same information from the console by executing these commands.
sc queryex "QEMU-GA"
sc queryex "QEMU Guest Agent VSS Provider"
Before the reboot, they should show output like this:
C:\Windows\system32>sc queryex "QEMU-GA"
SERVICE_NAME: QEMU-GA
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 4444
FLAGS :
C:\Windows\system32>sc queryex "QEMU Guest Agent VSS Provider"
SERVICE_NAME: QEMU Guest Agent VSS Provider
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 0
FLAGS :
After reboot it should have become this:
C:\Windows\system32>sc queryex "QEMU-GA"
SERVICE_NAME: QEMU-GA
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 1680
FLAGS :
C:\Windows\system32>sc queryex "QEMU Guest Agent VSS Provider"
SERVICE_NAME: QEMU Guest Agent VSS Provider
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 1624
FLAGS :
Verification
Verifying the qemu-agent is reachable from the Proxmox host:
- Note the VM ID of the VM as #
- Reboot the VM (for instance by typing this on the command prompt:
shutdown -r -t 0
)
- I’m not sure this step is needed under all circumstances; if the below steps don’t work then you definitely need it.
- Verify the Proxmox host can communicate with the qemu-agent on the VM:
On the Proxmox host, start a terminal session, then type these commands where # is the ID of the VM (I’ve used 112 as an example here):
# socat /var/run/qemu-server/112.qga -
{"execute":"guest-sync", "arguments":{"id":1234}}
It should get you this result:
{"return": 1234}
Note there’s all sorts of nice stuff you can do with socat /var/run/qemu-server
so maybe I’ll put more about it in a future blog post.
–jeroen
Some more links with background information:

Easiest is to download the ISO image to /var/lib/vz/template/iso on the Proxmox host so they show up as local:iso for mounting.
Like this:
Like Loading...