Install Proxmox qemu-guest-agent on Ubuntu 20.04

Read here how to install the qemu-guest-agent package on Ubuntu 20.04.

1. What is qemu-guest-agent?

The qemu-guest-agent is a helper daemon, which is installed in a guest VM. It is used to exchange information between the host and guest, and to execute command in the guest.

For example, when using Proxmox VE, the qemu-guest-agent is used for the following major features:

  1. To properly shutdown the guest, instead of relying on ACPI commands or windows policies
  2. To freeze the guest file system when making a backup (on windows, use the volume shadow copy service VSS).

It is a good practice to install the qemu-guest-agent on all VM’s for the above reasons but also various other stability tweaks and features.

2. Enable qemu-guest-agent on Proxmox for VM

The first step is to make sure the qemu-guest-agent option is enabled for your VM. In Proxmox VE you can do this as follows.

Firstly, connect to your Proxmox server web interface (by default this is https://proxmox_ip:8006). If the VM is currently running, shutdown the VM now.

Steps 1-3
  1. Select the VM, and click on the “options” tab.
  2. Click on the “QEMU Guest Agent” row.
  3. Click on the “Edit” button.
Steps 4-5
  1. Check the “Use QEMU Guest Agent” checkbox.
  2. Click “OK”.
  3. Boot the VM / turn it on.

3. Install QEMU guest agent on Ubuntu

Login to your Ubuntu VM via SSH and issue the following commands:

sudo apt -y install qemu-guest-agent
sudo systemctl enable qemu-guest-agent
sudo systemctl start qemu-guest-agent

Note: if you get a message saying “The unit files have no installation config” you can safely ignore it.

The qemu-guest-agent is now installed! You can check if the service is running with this command:

sudo systemctl status qemu-guest-agent

This command should give the following output:

● qemu-guest-agent.service - QEMU Guest Agent
     Loaded: loaded (/lib/systemd/system/qemu-guest-agent.service; static; vendor preset: enabled)
     Active: active (running) since Mon 2021-11-22 19:52:07 CET; 19min ago
   Main PID: 464 (qemu-ga)
      Tasks: 1 (limit: 4637)
     Memory: 1.0M
     CGroup: /system.slice/qemu-guest-agent.service
             └─464 /usr/sbin/qemu-ga

Another way to check if the qemu-guest-agent is running, is to view the “summary” tab in Proxmox. It should now show the IP address(es) currently in use by the VM:

Success!

By Leendert de Borst

Freelance software architect with 10+ years of experience. Expert in translating complex technical problems into creative & simple solutions.

Leave a comment

Your email address will not be published.