How to install Qemu guest agent for Debian / Ubuntu

Estimated reading time: 1 min

Install Qemu guest agent for Debian/Ubuntu

In this article, we will help you to install the Qemu guest agent on your virtual private server. This agent is a helper daemon that exchanges information between the quest and the host and executes commands in the guest for snapshot or backup. The guest agent is used for mainly two things one for properly shut down the guest and the second is to freeze the guest file system when making a backup.

Step 1: Log in using SSH

You must be logged in via SSH as sudo or root user. Please read this article for instructions if you don’t know how to connect.

Step 2: Install qemu guest agent

apt update && apt -y install qemu-guest-agent

Step 3: Enable and Start Qemu Agent

systemctl enable qemu-guest-agent
systemctl start qemu-guest-agent

Step 4: Verify

Verify that the Qemu quest agent is running

systemctl status qemu-guest-agent

Conclusion

Congratulations,  you have installed the Qemu guest agent on your Debian/Ubuntu based system.

Was this article helpful?
Dislike 5
Views: 67005

Reader Interactions

Comments

  1. ikomrad says

    Nope. I'm on ubuntu 20.04 lts, and the agent cannot be enabled and won't start manually.

    systemctl enable qemu-guest-agent
    Synchronizing state of qemu-guest-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install enable qemu-guest-agent
    The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
    Alias= settings in the [Install] section, and DefaultInstance= for template
    units). This means they are not meant to be enabled using systemctl.

    Possible reasons for having this kind of units are:
    • A unit may be statically enabled by being symlinked from another unit's
    .wants/ or .requires/ directory.
    • A unit's purpose may be to act as a helper for some other unit which has
    a requirement dependency on it.
    • A unit may be started when needed via activation (socket, path, timer,
    D-Bus, udev, scripted systemctl call, …).
    • In case of template units, the unit is meant to be enabled with some
    instance name specified.

    • Yavuz Aydin says

      Our Ubuntu 20.04 LTS installation does not provide this error. What is the output of the following command:
      dpkg -l qemu-guest-agent

      It should be something like:
      ii qemu-guest-agent 1:4.2-3ubuntu6.21 amd64 Guest-side qemu-system agent

      • Carlos says

        dpkg -l qemu-guest-agent
        Desired=Unknown/Install/Remove/Purge/Hold
        | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
        |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
        ||/ Name Version Architecture Description
        +++-================-=====================-============-=================================
        ii qemu-guest-agent 1:6.2+dfsg-2ubuntu6.6 amd64 Guest-side qemu-system agent

        • Yavuz Aydin says

          @Carlos:
          Either you aren't running Ubuntu 20.04 or you have invalid sources. A default Ubuntu 20.04 should show:

          ii qemu-guest-agent 1:4.2-3ubuntu6.24 amd64 Guest-side qemu-system agent

          Do you encounter any issues?

  2. brian says

    tried install this on debian using the commands above. one time it looked like it ran but performing the test said it didnt exist. Tried installing two more time only to receive the error package doesent exist.

Leave a Reply

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