---
title: 'How to get qemu guest agent working in freebsd'
url: 'https://grav.munn.me/my-blog/how-to-get-qemu-guest-agent-working-in-freebsd'
markdown: 'https://grav.munn.me/my-blog/how-to-get-qemu-guest-agent-working-in-freebsd.md'
date: '2025-08-13'
description: "I had some trouble today when trying to get the qemu guest agent working in freebsd and libvirt. Here are the processes to get it working. ensure that virtio_console driver is working ensure that you have properly modified your 'channel' to include a necessary qemu channel for serial ensure that y…"
---

# How to get qemu guest agent working in freebsd

I had some trouble today when trying to get the qemu guest agent working in freebsd and libvirt. Here are the processes to get it working.

1. ensure that virtio\_console driver is working
2. ensure that you have properly modified your 'channel' to include a necessary qemu channel for serial
3. ensure that you are installing the native qemu-guest agent from pkg not ports.

Here is the xml file that you need to add to your virtual machine (create new hardware with a channel type)

```xml
<channel type="unix">
  <target type="virtio" name="org.qemu.guest_agent.0"/>
  <address type="virtio-serial" controller="0" bus="0" port="2"/>
</channel>
```

Once that is done startup the vm and ensure that you are loading the proper drivers at boot time in loader.conf:

```
virtio_console_load="YES"
```

Once that is done you need to enable it at boot time in rc.conf:

```
qemu_guest_agent_enable="YES"
qemu_guest_agent_flags="-d -v -l /var/log/qemu-ga.log"
```

Finally, install qemu-ga package

```bash
pkg install qemu-guest-agent
```

That should be about it. This lets qemu manage freebsd from libvirt.

---

## Navigation

- Parent: [My Blog](https://grav.munn.me/my-blog.md)
- Previous: [How to get Garuda / KDE working with 3 monitors](https://grav.munn.me/my-blog/how-to-get-garuda-kde-working-with-3-montiors.md)
- Next: [How to get virsh serial console working with alpine](https://grav.munn.me/my-blog/how-to-get-virsh-serial-console-working-with-alpine.md)
