Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== bhyve/OpenBSD ====== ===== OpenBSD-UEFI Guests ===== As of %%FreeBSD%% 11.1-RELEASE, [[https://www.openbsd.org/59.html|OpenBSD 5.9]] [[https://ftp.openbsd.org/pub/OpenBSD/6.4/amd64/INSTALL.amd64|amd64]] and above can boot, install and run under bhyve’s native UEFI support (UEFI-GOP). **//Note://** All [[https://www.openbsd.org|OpenBSD]] [[https://ftp.openbsd.org/pub/OpenBSD/6.4/i386/INSTALL.i386|i386]] releases must use ''%%grub2-bhyve%%'' as booting with i386 using UEFI is not supported. The addition of the fbuf vga=vgaconf flag in [[https://www.freebsd.org/cgi/man.cgi?query=bhyve&apropos=0&sektion=0&manpath=FreeBSD+11.1-RELEASE+and+Ports&arch=default&format=html|bhyve(8)]] and setting it to ''%%off%%'', allows the %%OpenBSD%% kernel to boot after being invoked by the %%OpenBSD%% UEFI boot loader. Extending from the example provided on the [[bhyve/UEFI]] page: ==== Storage Preparation ==== <code> truncate -s 9G disk.img </code> A minimum sparse disk image of 9GB is recommended so that all [[https://www.openbsd.org/faq/faq4.html#FilesNeeded|file sets]] can be installed, especially if packages or ports are to be used within the %%OpenBSD%% guest. ==== Boot the OpenBSD-UEFI Virtual Machine ==== <code> bhyve -c 2 -m 4G –w -u -H \ -s 0,amd_hostbridge \ -s 3,ahci-hd,/path/to/install62.fs \ -s 4,virtio-blk,disk.img \ -s 5,virtio-net,tap0 \ -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,vga=off,wait \ -s 30,xhci,tablet \ -s 31,lpc -l com1,stdio \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ openbsd-uefi </code> This will create a virtual machine with 4GB of RAM with a display resolution of 800 by 600 that can be accessed via VNC at: ''%%0.0.0.0:5900%%'' The ''%%fbuf wait%%'' parameter instructs bhyve to only boot upon the initiation of a VNC connection, simplifying the installation of operating systems that require immediate keyboard input. This can be removed for post-installation use. Replace ''%%install62.fs%%'' with the current supported version of %%OpenBSD%% that you will be using as the guest. ISO images of the %%OpenBSD%% installer (install62.iso) will not boot in a UEFI environment as they do not contain the required UEFI components of the %%OpenBSD%% boot loader. As the installer is not in an ISO format, ''%%ahci-cd%%'' cannot be used in this instance. Specifying ''%%ahci-hd%%'' is required to allow the ''%%installXX.fs%%'' to be read by UEFI bootrom. When booting, depending on your VNC client, your VNC session may be disconnected (usually between switching from the boot loader to the kernel). Simply reconnect your VNC session and your console session will resume. After installation, remove ''%%-s 3,ahci-hd,/path/to/install62.fs%%'' and move the first disk from ''%%-s 4,virtio-blk,disk.img%%'' to ''%%-s 3,virtio-blk,disk.img%%''. This allows %%OpenBSD%% to boot normally after install. Slot 0 should use amd_hostbridge for all %%OpenBSD%% instances, even on Intel based hardware as MSI/MSI-x interrupts which are used by the xhci/tablet for accurate mouse control are not available in %%OpenBSD%% unless the hostbridge is advertised as AMD. ''%%sysutils/grub2-bhyve%%'' is not required for %%OpenBSD%%-UEFI. %%OpenBSD%%-UEFI installations have been tested with %%OpenBSD%% versions with UEFI support on %%FreeBSD%% 11.1-RELEASE hosts. ---- [[/CategoryVirtualization]] bhyve/openbsd.txt Last modified: 2020/01/10 00:20by JasonTubnor