Linux VPS

Install and use the QEMU guest agent on KVM VMs

Install qemu-guest-agent on Linux and Windows VMs, add the virtio-serial channel on the host, and use it for clean shutdowns, IP reporting, filesystem freeze for backups and password resets.

IntermediateKVM hosts and VMs2 min read

The QEMU guest agent is a small service inside a VM that lets the hypervisor ask the guest to do things: shut down cleanly, report its IP addresses, freeze filesystems for consistent snapshots, or set a user password. VPS panels and Proxmox rely on it for several features.

Before you start

  • A KVM VM you can log in to, and host access to edit the VM if the channel is missing.

Add the agent channel on the host

Most tools add it automatically (virt-install's newer defaults, Proxmox with Options → QEMU Guest Agent → Enabled). With plain libvirt, check virsh dumpxml vmname for:

<channel type='unix'>
  <target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>

If missing, add it with virsh edit and power-cycle the VM (a reboot inside the guest is not enough).

Install in a Linux guest

sudo apt install -y qemu-guest-agent

AlmaLinux/Rocky: sudo dnf install -y qemu-guest-agent. Then:

sudo systemctl enable --now qemu-guest-agent

If it fails to start, the virtio channel is missing on the host.

Install in a Windows guest

Run virtio-win-guest-tools.exe from the virtio-win ISO, which installs the agent as the QEMU Guest Agent service. See install a Windows VM on KVM.

Test from the host

virsh qemu-agent-command web01 '{"execute":"guest-ping"}'

An empty {"return":{}} means it works.

Useful things the agent enables

TaskCommand
Show guest IPsvirsh domifaddr web01 --source agent
Clean shutdown via agentvirsh shutdown web01 --mode agent
Freeze / thaw filesystemsvirsh domfsfreeze web01 / virsh domfsthaw web01
Consistent snapshotvirsh snapshot-create-as web01 snap1 --disk-only --quiesce
Set a user passwordvirsh set-user-password web01 root 'NewPass'
Guest infovirsh guestinfo web01

See KVM snapshots for quiesced snapshots.

Security considerations

  • The agent lets the host run privileged operations in the guest. That is expected on a VPS (the provider already controls the hardware), but you can restrict commands with the agent's allow/block lists.
  • Disable guest-exec and file commands if you do not need them.

Troubleshooting

  • "Guest agent is not responding": service not running, or channel missing; check systemctl status qemu-guest-agent.
  • Freeze fails on Windows: VSS service disabled; enable Volume Shadow Copy.
  • Panel shows no IP: install the agent and enable it in the VM options.

Frequently asked questions

Do I need the agent on my VPS?

It is recommended: it makes backups more consistent and panel shutdowns cleaner.

Is it the same as VMware Tools?

Similar role, for QEMU/KVM.

Does it use network access?

No, it talks over a virtio-serial channel, not the network.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.