Page MenuHomeFreeBSD

bhyve: Move the slirp backend out into a separate process
ClosedPublic

Authored by markj on Oct 29 2025, 8:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 2, 2:04 AM
Unknown Object (File)
Sun, Nov 30, 2:13 PM
Unknown Object (File)
Fri, Nov 28, 11:14 PM
Unknown Object (File)
Fri, Nov 28, 4:28 AM
Unknown Object (File)
Tue, Nov 25, 9:12 PM
Unknown Object (File)
Sun, Nov 23, 1:34 PM
Unknown Object (File)
Fri, Nov 21, 6:22 AM
Unknown Object (File)
Tue, Nov 18, 9:37 AM

Details

Summary

The previous implementation implemented hostfwd rules which would allow
the host to connect to the guest via a NATed TCP connection. libslirp
also permits NAT in the other direction, but this was prevented by
bhyve's capsicum sandbox.

To make the slirp backend more useful, split the backend out into a
separate process which does not enter capability mode if outbound
connections are permitted (enabled by setting the new "open" keyword).
The process communicates with the bhyve network frontend (typically a
virtio network interface) using a unix SOCK_SEQPACKET socket pair. If
the bhyve process exits, the helper will automatically exit.

Aside from this restructuring, there is not much actual change. Many
slirp parameters are still hard-coded for now, though this may change.
The "restricted" feature is toggled by the new "open" keyword; the
backend is restricted by default for compatibility with 15.0 and 14.3.

Each packet now has to traverse an extra socket, but this overhead
should be acceptable given that the slirp backend cannot be said to
provide high-performance networking. With iperf3 I can get 4Gbps from
the guest to the host.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable