Qemu guest agent on Ubuntu Guest VM.

Pxmx_Learner

New Member
May 2, 2021
7
0
1
Dear Experts

I realize our Ubuntu guest VMs are not running with Qemu guest agent as it disable by default.

Any experience of enabling it and issues if any.

Regards
 
On Debian I always do a "apt update && apt install qemu-guest-agent && systemctl start qemu-guest-agent" to install the QEMU guest agent. Should be the same with Ubuntu.
 
Last edited:
Hello Dunuin

Thanks, i did and enable the Qemu guest agent on our Ubuntu guest VM but looking for the advantages of using it,

As it was disabled by default from Proxmox.
 
qemu-ga allows execution of commands within the VM from the host.
this can be api controlled and is a crucial feature for our automation scripts.
 
One nice use of qemu-guest-agent on Linux is to setup fs-freeze/fw-thaw hook scripts. They will allow you to make sure that your apps do flush their caches to disk before creating a backup.

You could even perform other actions like telling MySQL to produce a mysqldump before the snapshot.

Take a look here.

PS: on Windows, qemu-guest-agent gets integrated with VSS to create consistent backups for any app VSS compliant.
 
Last edited:
And even without scripting it is useful because without it PVE can't use fsfreeze for consistent snapshots or "snapshot mode" backups.
 
qemu-ga allows execution of commands within the VM from the host.
this can be api controlled and is a crucial feature for our automation scripts.
Is there a way to allow a guest to access some host hardware? Specifically, I wan to run sensors within a VM but the guest doesn't see the hardware
 
Is there a way to allow a guest to access some host hardware? Specifically, I wan to run sensors within a VM but the guest doesn't see the hardware
Only way I know how to do that is by running ssh user@host sensors. You can automate the SSH login by using keys instead of a password.
EDIT: This is "just Linux" and not specific to Proxmox or QEMU Guest Agent.
 
Last edited:
I want to access CPU temp from a PHP generated webpage within the guest. ssh would work, thanks (ssh-keygen to make passwordless execution)
 
In case you got a real server with BMC you could also use the ipmitool inside the guest to read the temperatures/fanspeeds/voltages using IPMI.
 
This particular Proxmox install is on a Lenovo M93P Tiny which isn't a server platform so I suspect BMC isn't there
 
I just want to mention that starting the service will fail under Ubuntu. That is because you do not need to start or enable this guest agent service after you installed it on your guest.

Instead, you only need to stop and then start the VM again.

Terminal output:

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.
 
  • Like
Reactions: roxy

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!