Re: bhyve vm and virtio-console

From: Michael Gmelin <grembo_at_freebsd.org>
Date: Fri, 14 Feb 2025 19:57:52 UTC

On Fri, 14 Feb 2025 14:21:07 -0500
Petru Garstea <peter.garshtja@ambient-md.com> wrote:

> Hi,
> I am trying to configure bhyve vm with support of virtio-console, the 
> following option is added to bhyve command line
> 
> *-s 3,virtio-console,port1=/test/console.sock
> 
> *However when trying to connect to socket with socat trere are no 
> input/ouptut is observed.
> 
> Has virtio-console ever worked ?
> 

Yes it works, I just tried it using sysutils/vm-bhyve (just add
virt_console0="Yes" to the configuration file).

Based on the logs, these device settings are used by it:

    bhyve devices:
      -s 0,hostbridge \
      -s 31,lpc \
      -s 4:0,virtio-blk,/dev/zvol/zroot/vms/freebsd14-test/disk0 \
      -s 5:0,virtio-net,tap0,mac=58:9c:fc:aa:aa:aa \
      -s 6:0,virtio-console,0=/vms/freebsd14-test/vtcon.0

I could connect to /vms/freebsd14-test/vtcon.0 using socat:

    socat - UNIX-CONNECT:/vms/freebsd14-test/vtcon.0

Inside the vm it's /dev/vtcon/0.

-m

-- 
Michael Gmelin