- Create a zvol for your OpenBSD VM
- Add a VM with UEFI boot
- Change NIC to VIRTIO
- Add the zvol you created as a VIRTIO disk
- Inspect HTML source for the row for the VM, look for dgrid_vm-row-# where the # is the ID
- or subtract 5900 from the VNC Port
- or use the
sqlite3
command below - in new versions of FreeNAS it's listed in the GUI.
- remove VNC device
- you won't need it
- I guess you can keep it, but you can't install OpenBSD over it
-
Download an OpenBSD miniroot install image
# fetch https://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/miniroot62.fs
-
dd
it to the zvol you created# dd if=./miniroot62.fs of=/dev/zvol/ztank/vm_images/test bs=1M
- make sure this is your zvol
-
figure out the VM ID for your OpenBSD VM (if you didn't earlier)
# sqlite3 /data/freenas-v1.db 'SELECT id, name FROM vm_vm'
-
connect to the nmdm virtual console.
# cu -l /dev/nmdm3B
- where
3
is the id for your OpenBSD VM - I didn't find documentation about the fact that FreeNAS enables this serial console anywhere but the source.
- where
-
Start the VM by clicking start in the UI.
-
On the console
boot>
promptset tty com0
- and do the install making sure to set console to com0 and choose GPT disk partitioning
On the server hosting the install data:
-
Enable httpd and create an install.conf in /var/www/htdocs
-
Enable tftpd and download some files to /tftpboot:
cd /tftpboot ftp https://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/{BOOTX64.EFI,bsd.rd} ln -s BOOTX64.EFI auto_install mkdir etc echo "set tty com0\nset image bsd.rd" > etc/boot.conf
- You need a very current BOOTX64.EFI with patrick@'s patch that got committed on 2017-11-25.
-
On your DHCP server, set up the entry for your bhyve VM:
-
Finding the MAC is left as an exercise for the reader
-
Although I watched my dhcp server logs the first time I booted the VM.
-
But, before you remove the VNC device above you can connect to the EFI console there and
exit
from the shell and find the MAC in the menus.host test { option host-name "test"; hardware ethernet 00:XX:XX:XX:XX:30; fixed-address 192.168.0.71; next-server 192.168.0.50; # This is the IP of the install server filename "auto_install"; }
-
You can connect to the console on /dev/nmdm3B
as described above to do debugging, but once it works that is optional.
But, when you start the VM it should fall back to "EFI Network" and boot from the network.
Many thanks to @jre for helping me figure out that I needed to use the serial console to do this, and thanks to the FreeNAS team for actually connecting the VM to a serial console, even if it isn't documented.