The oVirt / QEMU Guest Agent is used by management applications to execute functions and operations inside a guest OS. Example of these is entering suspend, freezing and thawing filesystems. The guest agent is responsible for providing information, notifications, and actions between the oVirt web interface and the guest OS.

oVirt uses QEMU Guest Agent which is a daemon program that runs inside the domain. The agent provides the following information:
- Machine name – Show the virtual machine’s host name.
- Operating system version – Show the operating system’s version. Linux: this value is the kernel version. Windows: it is the Windows version name (e.g. Windows XP or Windows 7).
- IP(v4) addresses – List of all the virtual machine’s IP addresses. Only IPv4 addresses is reported.
- Installed applications – List in installed applications. Linux: application list is set using the configuration file. Windows: installed applications list is based on value read from registry.
- Available RAM – The amount of unused physical memory. This value probably include memory like cache, or else the memory usage will always be (or near) 100% usage.
- Logged in users – List of all logged-in users.
- Active user – The user which currently is using the virtual machine’s “physical hardware”. Redundant since RHEV-M is treating the SPICE’s ticket owner as the active user.
It is good to note that guest agent (GA) is not bullet proof, and hostile guest OS can send spurious replies. There is no third party repository needed to perform an installation of oVirt Guest Agent on Rocky / AlmaLinux 8|9. The package needed is available on the system default repositories.
You can confirm your OS release version using:
$ cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.8 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.8 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2029-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.8"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.8"
Then install QEMU / oVirt Guest Agent on Rocky / AlmaLinux 8|9 by running the following commands.
sudo dnf install qemu-guest-agent
Package details can be queried using rpm
command.
rpm -qi qemu-guest-agent
Ensure the service is started and set to automatically start on system boot.
sudo systemctl enable --now qemu-guest-agent
Check if the service is running:
$ systemctl status qemu-guest-agent
● qemu-guest-agent.service - QEMU Guest Agent
Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-05-05 21:13:34 EAT; 1 weeks 5 days ago
Main PID: 741 (qemu-ga)
Tasks: 2 (limit: 49028)
Memory: 1.6M
CGroup: /system.slice/qemu-guest-agent.service
└─741 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-see>
May 05 21:13:34 ipa.example.net systemd[1]: Started QEMU Guest Agent.
Conclusion
A guest agent is basically a daemon that connects to a virtio-serial device and feeds the input to a JSON parser. When a new command is received, it will hand the command over to the QAPI generated dispatch routines. The oVirt Guest Agent will notify on the following events.
- Power Up – Send when agent start its execution.
- Power Down – unused
- Heartbeat – Message is sent every few seconds to notify that the agent is running. The notification includes the guest’s available RAM.
- User Info – Active user was changed.
- Session Lock – Desktop was locked (Windows).
- Session Unlock – Desktop was unlocked (Windows).
- Session Logoff – A user was logged off (Windows).
- Session Logon – A user was logged on (Windows).
- Agent Uninstalled – Agent was removed from system. Expected to be sent from the agent’s installer.