Proxmox

QEMU Guest Agent Installation in Proxmox VE

Learn about the QEMU guest agent for communication and improved virtual machine management in Proxmox VE Server.

If you are running a Proxmox VE server in your home lab or production, there is a component that you will want to know and use with your guest virtual machines in the environment. The QEMU agent is a component that is akin to VMware Tools in VMware vSphere that will help your VMs have the best integration possible with your hypervisor host. Let’s look at the QEMU guest agent installation in Proxmox for performance and integration.

QEMU Guest Agent (QEMU GA) brief overview

First of all, let’s talk about the QEMU agent in Proxmox, what it does, why you need it, and how it can help with your virtualized environment. The QEMU agent is a helper daemon in your virtual machine that passes information back and forth between the guest operating system and the hypervisor.

It does many things related to getting information, backups, proper shutdowns, etc:

  • It allows executing commands in the guest OS and is used for proper shutdown of the guest
  • It is responsible for freezing the guest file system during backups or snapshot operations
  • It allows managing your guest virtual machines and displaying information for your guest environment such as IP addresses, etc.

Proxmox virtual machine management

Note the following benefits specific to the virtual machine qemu agent in Proxmox VE server:

  • The QEMU Agent provides a system-level agent via standard QMP commands
  • It enables the host to issue commands using libvirt and the guest operating system responds to these commands asynchronously
  • The QEMU Agent adds features like guest time management

Installing the QEMU Guest Agent in Proxmox VE Server

If you are running Proxmox, how do you install the QEMU agent in your guest virtual machines? Let’s look at that process.

Viewing the qemu agent status in the properties of a virtual machine
Viewing the agent status in the properties of a virtual machine

When you edit the QEMU agent configuration, you can enable:

  • Use QEMU agent
  • Run guest-trim after a disk move or VM migration
  • Freeze/thawing (guest fsfreeze freeze) file systems on backup for consistency
Enabling the qemu guest agent
Enabling the qemu guest agent

You will see the QEMU agent enabled, but we need to reboot at this point. Note any error message you might receive. However, this process is generally very straightforward.

The qemu guest agent has been enabled but needs a reboot
The agent has been enabled but needs a reboot

We choose to reboot the VM to install the qemu agent and so the agent is started on the next boot.

Initiating a vm reboot for installing the qemu ga
Initiating a vm reboot for installing the qemu ga

After the VM reboots, like VMware Tools does, we can see the IP address for the guest operating system, showing us the QEMU agent tools are installed.

Qemu agent is installed and reporting guest information like ip address
Qemu ga is installed and reporting guest information like ip address

Install QEMU guest agent in Linux

You can also install the QEMU agent in Linux using the command:

sudo apt install qemu-guest-agent

We can use QEMU agent systemctl commands to enable and start the service. Enable the Service to Start on Boot:

sudo systemctl enable qemu-guest-agent

Start the Service:

sudo systemctl start qemu-guest-agent

Install QEMU agent in Windows

Download the Installer:

Install the VirtIO drivers:

  • Run the installer and follow the wizard instructions

Verify the Service is started:

Enable QEMU guest agent in Proxmox via the command line

You can enable QEMU guest agent in Proxmox using the command line with the following command with replacing the VMID with your virtual

qm set <VMID> --agent enabled=1

Understanding QEMU Guest Agent Communication

Note the following aspects of the QEMU guest agent communication and how it communicates with the host, protocols used, and guest-sync exchange:

  • The QEMU Agent communicates with the host over a Unix socket located in /var/run/qemu-server/<my_vmid>.qga
  • The QEMU Agent protocol uses the same protocol as QMP. It also has some additional aspects for its isa-serial/virtio-serial transport
  • The guest-sync request/response exchange is used to make sure of safe communications between the host and guest

Below is a graphical overview of how the QEMU guest agent communicates with the host and protocols used.

High level overview of qemu guest agent communication
High level overview of communication

Best Practices for Virtual Machine Optimization

There are several best practices for virtual machine optimization when thinking about installing the QEMU agent. Note the following

  • You will want to install the QEMU agent on all virtual machines to enable enhanced virtual machine management.
  • Start the agent automatically on boot using the command sudo systemctl enable qemu-guest-agent.
  • You can use the QEMU agent to optimize virtual machine performance, including disk usage and clipboard open code

Troubleshooting the QEMU guest agent

You may run into a few issues with the QEMU agent running in guest operating systems in a Proxmox VE server environment. What are some of those?

  • The agent is not responding: You may need to restart the agent, using the command sudo systemctl restart qemu-guest-agent
  • You suspect their are issues with the QEMU agent: You may need to take a look at the QEMU agent logs for the service. You can do that with the command: sudo journalctl -u qemu-guest-agent.
  • You can also check the status of the service using the command: sudo systemctl status qemu-guest-agent

Wrapping up

The QEMU guest agent is an important component to a performant and manageable virtualization platform running on Proxmox. It is easy to install using the Proxmox web UI and the command line and it is an easy win for admins to make sure backups and snapshots are quiesced properly and you have the information you need for guest operating systems at your fingertips.

Making sure you have the QEMU agent installed is an aspect of making sure your Proxmox VE Server environment and the guest virtual machines are running according to best practices and the environment will perform and be stable when running your guest virtual machine workloads.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.