Install QEMU guest agent inside VM

On Linux

1. Install the agent inside the VM:

apt install qemu-guest-agent

2. Shut down the VM

shutdown -h now

3. Enable the guest agent in Proxmox Interface

4. Start the VM and check if the agent is running

systemctl status qemu-guest-agent

On FreeBSD 13

  1. Place virtio_console.ko in /boot/modules. (wget http://web.busana.lu/qemu/virtio_console.ko)
  2. Run kldload virtio_console.ko.
  3. Place qemu-ga in /usr/local/bin. (wget http://web.busana.lu/qemu/qemu-ga).
  4. Place qemu-guest-agent in /usr/local/etc/rc.d. (wget http://wwb.busana.lu/qemu/qemu-guest-agent)
  5. Place qemu-guest-agent in another location of your choice. This will be a copy that is re-added to the rc.d directory each time TrueNAS boots (/usr/local/qemuGB/qemu-guest-agent).
  6. Create Tunables in the TrueNAS web UI. System -> Tunables.
    1. Variable=qemu_guest_agent_enable Value=YES Type=RC Enabled=yes
    2. Variable=qemu_guest_agent_flags Value=-d -v -l /var/log/qemu-ga.log Type=RC Enabled=yes
    3. Variable=virtio_console_load Value=YES Type=LOADER Enabled=yes
  7. Create Init/Shutdown Scripts in the TrueNAS web UI. Tasks -> Init/Shutdown Scripts.
    1. Type=Command Command=service qemu-guest-agent start When=POSTINIT Enabled=yes Timeout=10
    2. Type=Command Command=cp /[path to a local copy of qemu-guest-agent file] /usr/local/etc/rc.d  When=PREINIT Enabled=yes Timeout=10 (cp /usr/local/qemuGB/qemu-guest-agent /usr/local/etc/rc.d).
  8. Reboot TrueNAS.

Leave a Reply