vm-bhyve
vm-bhyve copied to clipboard
Installing OpenBSD 6.7 with UEFI
Wanted to share some issues I ran into while attempting to install OpenBSD 6.7 with UEFI. I'll also shared some solutions. I did end up getting it to work.
I wanted to boot with UEFI mostly because the grub options are specifying /bsd as the kernel, and this is a bit inconvenient with the new sysupgrade command in OpenBSD 6.6. sysupgrade works by setting the system to to reboot into /bsd.upgrade. I wanted to avoid having to change the grub/vm config on every upgrade.
This is all on the latest vm-bhyve code from github, not the FreeBSD port.
And the bhyve host is FreeBSD 12.1.
I'm using the following config:
loader="uefi"
cpu=2
memory=4G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
disk0_dev="sparse-zvol"
bhyve_options="-w"
And installed with the install67.fs like so:
# vm install -i openbsd0 install67.fs
The issue is the vm seems to reboot, and end up here:
Boot Failed. EFI DVD/CDROM
Boot Failed. EFI Misc Device
.
I ended up trying to run bhyve manually to see what was happening. So I ran this:
#!/bin/sh
bhyve -c 1 -m 4G -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
-s 0,hostbridge \
-s 31,lpc -l com1,stdio \
-s 3:0,ahci-hd,/zroot/vm/.iso/install67.fs,ro \
-s 4:0,virtio-blk,/dev/zvol/zroot/vm/openbsd1/disk0.img \
-s 5:0,virtio-net,tap3,mac=58:9c:fc:01:ff:4e \
-w -U 27a7faf6-b43a-11ea-8c58-a4bf0142e81c \
openbsd1
And was able to see a bit more about what was going on.
probing: pc0 com0 com1 mem[640K 3049M 16M 20K 4M 64K 1024M]
disk: hd0 hd1*
>> OpenBSD/amd64 BOOTX64 3.50
boot>
cannot open hd0a:/etc/random.seed: No such file or directory
booting hd0a:/6.7/amd64/bsd.rd: 3826379+1557504+3881976+0+598016 [301104+128+465696+311208]=0xa71778
entry point at 0x1001000
rdmsr to register 0xc80 on vcpu 0
I googled that last line and ran across this issue:
https://github.com/machyve/xhyve/issues/179
That post gave me the workaround. At the OpenBSD boot loader run:
set tty com0
This lets the boot continue, I could install successfully. And after that, it boots just fine. The installer asks if you want to set the console to com0, so I said yes. I think that makes future boots ok.
I'm not sure if this is a bug in bhyve, or OpenBSD, but I thought it might be useful to report here in case it helps anyone else, or if it should be documented on the Wiki.
You have identified that it is wanting a graphical output as standard. You flicked it over to serial and you can use cu. Setting graphics options and using VNC, you can boot and install without modifications.
I have a pull request waiting for Matt to include a template that will work for a standard OpenBSD UEFI install out of the box:
https://github.com/churchers/vm-bhyve/pull/388