Proxmox: QEMU Guest Agent How To
Proxmox offers support for the QEMU Guest Agent helper daemon on both Linux and Windows. We’ll discuss why this is important, as well as how to implement it on Linux virtual machines.
What Purpose Does the QEMU Guest Agent Serve?
According to QEMU, when ran inside a virtual machine, the QEMU Guest Agent allows the hypervisor host to perform various operations in the guest, including:
- Getting information from the guest
- Setting the guest’s system time
- Reading/writing a file
- Syncing and freezing the filesystems
- Suspending the guest
- Reconfiguring guest local processors
- Setting a user’s password
How Does Proxmox Use the QEMU Guest Agent?
According to Proxmox, it is used mainly for 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, uses the volume shadow copy service VSS)
Installation on Guest Virtual Machines
The following commands must be ran as root or via sudo
within the respective virtual machine
Debian and Ubuntu Based Systems
This includes distributions like Linux Mint and Raspberry Pi OS.
~ $ apt-get install qemu-guest-agent
RedHat Based Systems
This includes distributions like CentOS and Rocky Linux.
~ $ dnf install qemu-guest-agent
If you are on an older RedHat based system where dnf
is not available, please use yum
:
~ $ yum install qemu-guest-agent
Tell Linux to Start QEMU Guest Agent on Boot
The following command tells the system to start qemu-guest-agent automatically at boot, as well as starts it immediately if it’s not already running:
~ $ systemctl enable --now qemu-guest-agent
Configure Virtual Machine on Proxmox
- Select the virtual machine in Proxmox
- Click on “Options”
- Click the item with the Name “QEMU Guest Agent”
- Click the “Edit” button
- In the popup modal window, check the option with the label “Use QEMU Guest Agent”
- Click the “OK” button
Test QEMU Guest Agent Installation
After installing the QEMU Guest Agent on a virtual machine, it’s good practice to validate that it is working. From the Proxmox shell, run the following command, replacing vmid
with the ID of the virtual machine you are looking to test:
root@pve:~# qm agent vmid ping
A successful test result is when no error message is returned.