You created a VM from a cloud image (Debian, Ubuntu), ticked the QEMU Guest Agent option, and yet Proxmox shows "Guest Agent not running" and no IP address in the Summary tab. This is the classic trap: cloud images do not ship the agent, and the option on the VM side is not enough. This guide explains the three pieces of the puzzle and the three ways to install the agent, with the most reliable one (cloud-init) tested on PVE 9. It is aimed at anyone automating cloud-init VMs, and it also shows how to enable the agent on an existing VM without cutting it off by force.
What you will learn
- Why "Guest Agent not running" appears even though the option is ticked.
- Install the agent cleanly through cloud-init (snippet).
- The alternatives (virt-customize, post-boot) and their pitfalls.
- Enable the agent on an existing VM with a clean shutdown, without
qm stop. - Check that the agent answers and that the IP address comes back.
What is the agent for?
The qemu-guest-agent is a small daemon that runs inside the guest and gives Proxmox three services:
- reporting the IP address in the Summary tab (without it, the network works, but the address is not displayed on the hypervisor side);
- a shutdown request sent to the guest:
qm shutdowngoes through the agent if it is active, otherwise through ACPI, which the guest also handles cleanly; - consistent backups: Proxmox freezes the filesystem (
fsfreeze) while the snapshot is taken.
ACPI is therefore not a brutal shutdown: it is a shutdown request, like pressing the power button of a server. The brutal shutdown is qm stop, which cuts the VM off like pulling a plug and which Proxmox logs as a qmstop task. Without the agent, this request is still possible; the agent is mostly there to report the IP address and to freeze the filesystem before a snapshot.
The real problem: three pieces, not one
The most common mistake is to believe that a single action is enough. Three are needed, spread across both sides.
| Step | Where | Command | If forgotten |
|---|---|---|---|
| Enable the channel | VM side | qm set <vmid> --agent enabled=1 | the agent cannot communicate |
| Install the package | guest side | apt install qemu-guest-agent | nothing listens on the channel |
| Enable the service | guest side | systemctl enable --now qemu-guest-agent | the agent is there but inactive |
Cloud images do not have the package: steps 2 and 3 are almost always the missing ones.
Method 1: cloud-init (the most reliable)
For a cloud-init VM, you ask cloud-init to install and enable the agent on first boot, through a snippet (a small cloud-init configuration file). The storage must accept the snippets content type (on local, in /var/lib/vz/snippets/).
-
Create the snippet in
/var/lib/vz/snippets/qemu-agent.yaml:#cloud-configpackages:- qemu-guest-agentruncmd:- systemctl enable --now qemu-guest-agent -
Attach the snippet to the VM with
vendor=, neveruser=:Terminal window qm set <vmid> --cicustom "vendor=local:snippets/qemu-agent.yaml"
On the lab, the proof that it works, once the VM has started:
qm agent <vmid> ping# (no error = the agent answers)qm agent <vmid> network-get-interfaces# ... "ip-address": "192.168.10.238" ... -> the IP address comes backMethod 2: virt-customize (watch out for the trap)
You can also inject the agent into the image before creating the VM:
apt install -y libguestfs-toolsvirt-customize -a debian-13-genericcloud-amd64.qcow2 \ --install qemu-guest-agent \ --run-command 'systemctl enable qemu-guest-agent' \ --truncate /etc/machine-idThe --truncate /etc/machine-id prevents all clones from inheriting the same machine-id (and therefore the same DHCP address).
Method 3: inside the already running VM
The most direct route when the VM is already running and you can connect to it:
apt update && apt install -y qemu-guest-agentsystemctl enable --now qemu-guest-agentEnable the channel without forcing the VM off
Whichever installation method you used, the channel is set on the Proxmox side, and the VM must start again from a full boot for the guest to see it. The clean sequence never cuts the VM off by force:
qm shutdown <vmid>qm set <vmid> --agent enabled=1qm start <vmid>qm shutdown asks the guest to shut down: through the agent if it is already active, otherwise through ACPI, which the guest handles cleanly. The option is then set on the stopped VM, and qm start restarts it with the new hardware.
Keep qm stop for a VM that no longer responds: it cuts the VM off without warning the guest, with the risk of lost writes, and Proxmox logs it as a qmstop task.
Check it end to end
# from the Proxmox hostqm agent <vmid> ping # no error = communication OKqm agent <vmid> network-get-interfaces # the IP address must appear
# inside the guestls -l /dev/virtio-ports/org.qemu.guest_agent.0 # the device existssystemctl is-active qemu-guest-agent # activeThe complete proof comes down to two findings: qm agent ping returns no error, and the IP address appears in the Summary tab of the interface.
Common pitfalls
| Symptom | Cause | Solution |
|---|---|---|
| "Guest Agent not running" persists | option ticked but package missing | install qemu-guest-agent in the guest |
| Still nothing after the install | the VM has not done a full boot since the option was enabled | qm shutdown, qm set <vmid> --agent enabled=1 on the stopped VM, then qm start |
| virt-customize "succeeds" but the agent is missing | no DNS in the appliance | dhcpcd-base on the PVE 9 host |
systemctl finds nothing | you are looking for qemu-ga | the unit is qemu-guest-agent, the process is qemu-ga |
| Clones with the same IP address | identical machine-id | --truncate /etc/machine-id on the image |
Put it into practice
In the lab, the agent of VM 180 does not answer, for one of two causes drawn at random: the device is not enabled in Proxmox, or the package is missing from the guest. You diagnose, then restore the agent without forcing the VM off. The validation checks that the device is enabled, that qm agent 180 ping answers, that the /dev/virtio-ports/org.qemu.guest_agent.0 channel exists in the guest and that an address comes back. It also reads the task log: a single qmstop since the start of the lab fails the criterion.
Key takeaways
- The agent needs three pieces: the channel (
--agent enabled=1), the package and the service. The option alone is not enough. - For a cloud image, the reliable method is cloud-init with a
vendor=snippet (packages: qemu-guest-agent). - virt-customize fails silently without DNS: install
dhcpcd-baseon the PVE 9 host and check the result. - After
--agent enabled=1, chainqm shutdown, the option on the stopped VM, thenqm start. ACPI asks for a clean shutdown;qm stopis the forced shutdown, reserved for a VM that no longer responds. - Proof:
qm agent pingwithout an error and the IP address in the Summary tab.