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.

Prerequisites

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 11
Views: 125969

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?

          • ADG says

            I get the same error.
            I am using Ubuntu 20.04.6 LTS via Qemu. I see the same output as Carlos.
            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

            But i also get this error

            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.

            On checking the status, i get :

            systemctl status qemu-guest-agent
            ● qemu-guest-agent.service – QEMU Guest Agent
            Loaded: loaded (/lib/systemd/system/qemu-guest-agent.service; static; vendor preset: enabled)
            Active: inactive (dead)

            Jul 18 16:13:12 pve systemd[1]: Dependency failed for QEMU Guest Agent.
            Jul 18 16:13:12 pve systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.

  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.

  3. Dan Bachar says

    Hello Yavuz,

    I'm getting a very similar error message.
    `dpkg -l qemu-guest-agent` yields the following output:

    “` 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:7.2+dfsg-5ubuntu2.2 amd64 Guest-side qemu-system agent“`

    My system has the following CPU and vmx flags:
    “`flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear arch_capabilities
    vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs“`

    I'm running Ubuntu 23.04.

Leave a Reply

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