I can't get a guest to start without a display.
If there's a way to do it, I can't get it to work.
I'm using 10.3. Any advice?
If there's a way to do it, I can't get it to work.
I'm using 10.3. Any advice?
bhyve ... -l com1,/dev/nmdm0A ...
cu -l /dev/nmdm0B
-c /dev/nmdmA
option, although you probably don't need to do that when running bhyveload/bhyve by hand. bhyve ...options... guest &
to have it actually run in the background and return you to your terminal.bhyveload -c /dev/nmdm1A -m 1024 -d /vm/f1/f1.img f1
bhyve -c 1 -m 1024M -H -P -A \
-l com1,/dev/nmdm1A \
-s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-net,tap2 \
-s 4,virtio-blk,/vm/f1/f1.img f1
bhyveload -c /dev/nmdm1A...
-l com1,/dev/nmdm1A...
+1 for sysutils/vm-bhyve. I really like itUnless you really want to get your hands dirty I'd recommend just using something like my sysutils/vm-bhyve manager
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: obsd
# REQUIRE: some necessary stuff here
# BEFORE: some other stuff
# KEYWORD: shutdown
. /etc/rc.subr
name="obsd"
rcvar=${name}_enable
command="/usr/local/bin/${name}"
desc="OpenBSD7.2 running in bhyve hypervisor"
procname="bhyve"
pidfile="/var/run/$procname.pid"
start_cmd=${command}
stop_cmd=${name}_stop
start_precmd=${name}_prestart
obsd_prestart()
{
if [ ! -e /dev/nmdm0A ]; then
kldload nmdm
fi
}
obsd_stop()
{
pkill $procname
sleep 20
}
load_rc_config $name
run_rc_command "$1"
... -l com1,/dev/nmdm0A ... $my-vm-name &
. This allows to start it silently WIHTOUT any need for a terminal. Although it does use /dev/nmdm0A, it doesn't require me listening on cu -l /dev/nmdm0B
to move any further than bhyve(8) start command. So the script includes $start_precmd to check if such device exists and the module loaded. Of course, nmdm_load="YES" is put into /boot/loader.conf, but additional checking won't hurt, right? sleep 20
is added because, for some reason or other, my OpenBSD system reacts to pkill bhyve
within that time. And if killed prematurely, it will then run fsck on startup...