Installation of qemu-guest-agent — Linux

qemu-guest-agent is in the repositories of all popular distributions.

In Debian-like (Debian, Ubuntu, Mint) is installed with the help of the command:

sudo apt install qemu-guest-agent

The RedHat-like (Red Hat, CentOS, Fedora, Oracle Linux) team installation:

sudo yum install qemu-guest-agent

There is some chance that in newer distributions you may need to use the dnf command instead of yum. However backward compatibility is provided at the command level by default in all distributions we know that have switched to dnf package manage using.

Run the commands after installation:

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

The first command includes starting the service at system startup (it has an effect after machine rebooting accordingly). The second command starts the service, since it does not start on its own after installation.

For older distributions (e. g. CentOS 6) where not yet used systemd, the commands used will be different:

sudo chkconfig qemu-ga on
sudo service qemu-ga start

Special individual applications/services may also require preparation, in addition to the system itself, for example DBMS. You can use guest agent capabilities to prepare them. For example, script can be placed in the directory /etc/qemu-ga/fsfreeze-hook.d/ to be run with the argument freeze before snapshot creating and with thaw immediately after, which will prepare your app for the upcoming snapshot in the special way. An example of such a script for MySQL is on the path:

/usr/share/qemu-kvm/qemu-ga/fsfreeze-hook.d/mysql-flush.sh.sample

Please check agent's documentation for more information.