bhyve with qemu-ga (guest agent)

From: Markus Wild <fbsd-lists_at_dudes.ch>
Date: Tue, 23 May 2023 09:39:35 UTC
Hello,

I'm trying to use qemu guest agent to for example make use of
freeze/thaw for consistent live zfs-snapshots on the host (to backup
VMs). qemu-ga wants to use a specific virtio-serial port by default, so
I tried to start bhyve using:

bhyve -c 2 -m 4G -Hwl
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
  -U 54ac18e6-f643-11ed-a64e-7085c2b3862f -s 0,hostbridge -s 31,lpc \
  -s 4:0,nvme,/bhyve/test2019/disk0.img \
  -s 5:0,virtio-net,tap2,mac=58:9c:fc:04:aa:53 
  -s 6:0,fbuf,tcp=0.0.0.0:5901 -s 7:0,xhci,tablet \
  -s 8:0,virtio-console,port1=/bhyve/test2019/org.qemu.guest_agent.0 \
  test2019

this causes windows to show "VirtIO Serial Driver" under "System
Devices", but bhyve on the host does not create the Unix Domain Socket
at the requested path. I also don't know how to query the Windows
namespace to check whether the proper named pipe has been created.

When I try the same thing with an ubuntu20 VM,
it's looking for the port at /dev/virtio-ports/org.qemu.guest_agent.0,
but no such directory even exists within /dev.

So:
- is the bhyve virtio-console device something different than
  virtio-serial?
- why does this device not open a unix socket on the host?

BTW: if I use isa-serial, I can communicate with the qemu-ga, but I'd
prefer to get it working with the default method.

Cheers,
Markus