Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
Resource icon

Resource QEMU Guest Agent 2021-03-11

DISCLAIMER:
Under no circumstances will I be held responsible or liable in any way for any claims, damages, losses,
expenses, costs, or liabilities whatsoever (including, without limitation, any direct or indirect damages for loss of profits, business interruption, or loss of information) resulting from or arising directly or indirectly from your use of these files and/or the instructions within this post.

Credit to @Tomek_ for the assistance provided in getting these binaries built and setup!
Credit to aborche! https://github.com/aborche/qemu-guest-agent


Contained in the zip archive are three files.
Code:
qemu-ga
qemu-guest-agent
virtio_console.ko


  1. Place virtio_console.ko in /boot/modules.
  2. Run kldload virtio_console.ko.
  3. Place qemu-ga in /usr/local/bin.
  4. Place qemu-guest-agent in /usr/local/etc/rc.d.
  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.
  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
  8. Reboot TrueNAS.

After running through these steps the QEMU guest agent should be running. I am personally running the binaries provided on my TrueNAS which is running in Proxmox. The IP information is reported back to Proxmox and Proxmox is able to gracefully shutdown/reboot the TrueNAS virtual machine.

For further information please see this thread https://www.truenas.com/community/threads/freenas-on-proxmox-whats-the-current-state-of-play.84287/.

Enjoy.

FS
Author
fsociety3765
Downloads
63,204
Views
130,917
First release
Last update
Rating
4.67 star(s) 3 ratings

Latest reviews

Works like a charm, thank you. If using Proxmox remember to enable QEMU guest agent in the VM's option menu.
The only missing commands were to make qemu-ga and qemu-guest-agent executable by chmod +x command
Nice work with good install guidelines.
Top