BSD Ports

sysutils/bhyve-rc 4 FreeBSD

FreeBSD RC script for starting bhyve guests in tmux

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
Categories
sysutils
Package size
2.5 KiB, 3.8 KiB installed

Description

FreeBSD RC script to start bhyve guests in tmux.

In the other systems

SystemPortVersion
FreeBSDsysutils/bhyve-rc4
DragonFlysysutils/bhyve-rc4

Install

Binary package:

pkg install bhyve-rc

From the ports tree:

cd /usr/ports/sysutils/bhyve-rc/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	bhyve-rc>0:sysutils/bhyve-rc

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest44444
FreeBSD:14:quarterly44n/a44
FreeBSD:15:latest44n/a44
FreeBSD:15:quarterly44n/an/an/a
FreeBSD:16:latest44n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Runtime 1

The full lists below include those, and their dependencies in turn.

Run dependencies 2

No port depends on this one.

Configuration

No options to configure.

Service scripts
bhyve

Message after installing

Configuration is done completely though rc.conf.
The rc script won't touch any devices for you (neither disk, nor tap)
so you need to make sure all of those have been initialized properly.

General setup:
kldload vmm
net.link.tap.up_on_open=1

Make it persistent:
echo "net.link.tap.up_on_open=1" >> /etc/sysctl.conf
cat >> /boot/loader.conf << EOF
vmm_load="YES"
EOF

Minimal example:
cat >> /etc/rc.conf << EOF
cloned_interfaces="tap0 bridge0"
bhyve_enable="YES"
bhyve_diskdev="/dev/zvol/tank/bhyve/virt"
EOF

ifconfig tap0 create
ifconfig bridge0 create

service bhyve start
tmux list-sessions
tmux attach -t bhyve
service bhyve status
service bhyve stop

Multi profile configuration example:
cat >> /etc/rc.conf << EOF
cloned_interfaces="tap0 tap1 bridge0"
bhyve_enable="YES"
bhyve_profiles="virt1 virt2"
bhyve_virt1_diskdev="/dev/zvol/tank/bhyve/virt1"

bhyve_virt2_tapdev="tap1"
bhyve_virt2_diskdev="/dev/zvol/tank/bhyve/virt2"
bhyve_virt2_memsize="8192"
bhyve_virt2_ncpu="4"
EOF

ifconfig tap0 create
ifconfig tap1 create
ifconfig bridge0 create

service bhyve start # start all
service bhyve start virt2 # start individual
tmux attach -t bhyve_virt1
tmux attach -t bhyve_virt1
service bhyve stop virt2 # stop individual
service bhyve stop # stop all

(by default ctrl-b d detaches from tmux).

Files

No file lists for this port.

Commit history 0

No commits in the history this site was built from.