This is a guide for Installing and Configuring QEMU Guest Agent for TrueNAS 13. It is based on the QEMU Guest Agent and VirtIO Console driver from FreeBSD 13.
Due to the TrueNAS kernel lacking certain FreeBSD drivers, it's necessary to download the FreeBSD 13 kernel, extract the VirtIO Console driver and integrate it into the TrueNAS system. This ensures TrueNAS compatibility with virtualized environments.
Required packages for this guide:
- VirtIO Console driver: Man Page
- Install
sed -i .orig 's/enabled: yes/enabled: no/' /usr/local/etc/pkg/repos/local.conf
sed -i .orig 's/enabled: no/enabled: yes/' /usr/local/etc/pkg/repos/FreeBSD.conf
pkg update
pkg install qemu-guest-agent
- Backup
Backup installed /usr/local/etc/rc.d/qemu-guest-agent
to /root/qga_backup/
. This will be a copy that is re-added to the rc.d directory each time TrueNAS boots.
-
Create the following Tunables in the TrueNAS web UI under System -> Tunables:
- Variable:
qemu_guest_agent_enable
, Value:YES
, Type:RC
, Enabled:yes
- Variable:
qemu_guest_agent_flags
, Value:-d -v -l /var/log/qemu-ga.log
, Type:RC
, Enabled:yes
- Variable:
virtio_console_load
, Value:YES
, Type:LOADER
, Enabled:yes
- Variable:
-
Set up Init/Shutdown Scripts in Tasks -> Init/Shutdown Scripts:
- Type:
Command
, Command:service qemu-guest-agent start
, When:POSTINIT
, Enabled:yes
, Timeout:10
- Type:
Command
, Command:cp /root/qga_backup/qemu-guest-agent /usr/local/etc/rc.d
, When:PREINIT
, Enabled:yes
, Timeout:10
- Type:
-
Reboot TrueNAS to apply changes.