Page MenuHomeFreeBSD

Add virtio-console support to bhyve

Authored by jceel on Jul 11 2016, 1:19 PM.



Adds virtio-console device support to bhyve, allowing to create bidirectional character streams between host and guest.

-s <slotnum>,virtio-console,port1=/path/to/port1.sock,port2=/path/to/port2.sock,...

Maximum of 16 ports per device can be created. Every port is named and corresponds to an Unix domain socket created by bhyve. bhyve accepts at most one unix domain socket connection per port at a time.


  • due to lack of destructors of in bhyve, sockets on the filesystem must be cleaned up manually after bhyve exits
  • there's no way to use "console port" feature, nor the console port resize as of yet
  • emergency write is advertised, but no-op as of yet
Test Plan

Start FreeBSD guest in bhyve with -s 9,virtio-console,testport=/tmp/testport.sock. Type kldload virtio_console in the guest, then cu -l /dev/ttyV0.0 in the guest and socat - /tmp/testport.sock in the host.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jceel retitled this revision from to Add virtio-console support to bhyve.
jceel updated this object.
jceel edited the test plan for this revision. (Show Details)
jceel added reviewers: grehan, trasz.
jceel set the repository for this revision to rS FreeBSD src repository - subversion.
jceel added a subscriber: freebsd-virtualization-list.

Cast basename() argument to char *.

This revision was automatically updated to reflect the committed changes.