Installing OPNsense

Dunuin

Contributor
Joined
Mar 7, 2013
Messages
110
Hi,

I'm trying to setup two OPNsense 21.1 so they can work in HA configuration.
Installing on Proxmox went fine (after I've chosen grub and not UEFI because if you want to use UEFI you need to choose Q35 and its in the OPNsense FAQ that OPNsense won't work on KVMs Q35).

But now I don't know why OPNsense on bhyve won't work.

I've encounter problems with hanging installation but that is a known bug between the font and VNC and can be skipped by CTRL+C or chaning the font.
Next I tried to set the VM to grub to install OPNsense using grub but that doens't work because FreeNAS won't work with grub anymore.
Next I set the VM to UEFI and tried to install it using UEFI but the installer tries to write a file "/bin/dd if=/boot/boot1.efifat of=/dev/vtbd0p1" and that fails. If I skip that file all the other files are written fine to the zvol but the VM won't boot. I only get "Boot failed. EFI Misc Device". I bet that "boot1.efifat" was the EFI bootloader.

In Proxmox I need to add a "EFI Disk device" if I want to use UEFI. How is this handled in bhyve?

What am I doing wrong that the "boot1.efifat" can't be installed? I tried AHCI and VirtIO as Disk and pointed it my my zvol I created earlier.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
FreeNAS won't work with grub anymore.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Try to create the VM with just VirtIO network interfaces and disk. Use cu -l /dev/nmdmXYB (proper device is shown in "Virtual Machines" in the matching column) to connect to the serial console of the VM. And use the serial console install image, of course.
And UEFI is correct and should work. It's a FreeBSD VM, so no grub necessary. I can try myself later today, just not right now.

if I can reproduce your problem I will happily carry it over to the OPNsense forum. :wink:
 

Dunuin

Contributor
Joined
Mar 7, 2013
Messages
110
Thanks. I already read that guide. But as OPNsense is a network critical VM I'm not sure if it is a good idea to "hack" something on FreeNAS to force GRUB to work if ixsystems don't want you to use GRUB anymore and removed it from GUI. I would like to run that VM for several years and I would think that I could run into problems with future FreeNAS updates.

Try to create the VM with just VirtIO network interfaces and disk. Use cu -l /dev/nmdmXYB (proper device is shown in "Virtual Machines" in the matching column) to connect to the serial console of the VM. And use the serial console install image, of course.
And UEFI is correct and should work. It's a FreeBSD VM, so no grub necessary. I can try myself later today, just not right now.

if I can reproduce your problem I will happily carry it over to the OPNsense forum. :wink:
If I understand it right only the "dvd" (I used that to install) and "vga" install images support UEFI. And "serial" and "nano" install images only MBR/GRUB.

Can you give me a hint how to boot a VM from a USB installer image? There is no Iso installer for the serial installation.

This is my zvol:
vm1.png

This my VM:
vm2.png

And This my Disk device for that VM:
vm3.png

By the way, booting from the "dvd" installer image with UEFI works fine and I can run OPNsense in live mode. Even the installation is able to finish if I skip writing that "boot1.efifat" file. But after the installation there is no efi bootloader file on the disk I can boot from. I also tried to use the "Boot Maintenance Manager" to boot from a EFI file I could choose but I wasn't able to find any.

Would be great if you could test if it works on your FreeNAS.

I also asked in the OPNsense forum but no answer yet.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You can try these steps after booting into the live system:
Code:
newfs_msdos /dev/vtbd0p1
mount_msdosfs /dev/vtbd0p1 /mnt
mkdir -p /mnt/efi/boot
cp /boot/boot1.efi /mnt/efi/boot/bootx64.efi
umount /mnt
 

Dunuin

Contributor
Joined
Mar 7, 2013
Messages
110
You can try these steps after booting into the live system:
Code:
newfs_msdos /dev/vtbd0p1
mount_msdosfs /dev/vtbd0p1 /mnt
mkdir -p /mnt/efi/boot
cp /boot/boot1.efi /mnt/efi/boot/bootx64.efi
umount /mnt
Thanks, that worked. My OPNsense is now UEFI booting from the zvol :)
 
Top