OPNsense Forum

English Forums => Hardware and Performance => Topic started by: zucca on September 15, 2024, 04:10:03 AM

Title: FreeBSD and pfSense boot, opnSense does not.
Post by: zucca on September 15, 2024, 04:10:03 AM
Long time pfSense user here. Two days ago I decided to give opnSense a try to check all the hype around it.

Lenovo ThinkCentre M72e (amd64).

BIOS set to UEFI only.
Secure boot deactivated.

ZFS mirror on 2 disk. GPT UEFI only.

opnSense 24.7 installs but then "OS can't be found"  ???

So I tried FreeBSD and pfSense, same BIOS and install settings of course:
FreeBSD 14.1 installs and boots no problem.
pfSense 2.7.2 CE installs and boots no problem.

To add more confusion, after opnSense is installed if I boot on a Ventoy USB disk and select "F4 localboot" and then tell Ventoy to look for a UEFI boot, IT DOES BOOT IN opnSense.

Tried VGA, DVD .iso installer images...

This opnSense box is kind of an experiment, so feel free to tell me what I have to do confirm it is a opnSense bug (surely affecting only with the my Lenovo HW) that need to be reported.

Furthermore I was able to boot opnSense in bios/legacy... but I am trying to help the opnSense project reporting a bug... maybe.
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: chemlud on September 15, 2024, 09:18:46 AM
...bootstrap from freeBSD maybe?

https://docs.opnsense.org/relations/freebsd.html
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: DEC670airp414user on September 15, 2024, 02:02:20 PM
looks like you found the fix.

Legacy ata bios mode.   non Raid

go with that and run your tests.     without providing the chipset I doubt the driver for the raid controller can be loaded into Opnsense
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: Patrick M. Hausen on September 15, 2024, 02:12:32 PM
Don't use "hardware RAID", simply install with ZFS instead.
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: zucca on September 15, 2024, 04:19:04 PM
Guys I use ZFS not a RAID HW.

I will look into the FreeBSD bootstrap, but if the 14.1 boots no problem, why the problem should be there?
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: chemlud on September 15, 2024, 04:46:55 PM
Maybe a little more detail how you installed? Login as user "installer" and things? :-)
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: zucca on September 16, 2024, 03:45:55 AM
Quote from: chemlud on September 15, 2024, 04:46:55 PM
Maybe a little more detail how you installed? Login as user "installer" and things? :-)

Sorry I thought I gave all the relevant details.

Boot off the USB stick in UEFI mode

user: installer
psw: opnsense

select keyboard, when prompted for 'Other Modes' choose auto guided ZFS (this way it is comparable with pfSense and FreeBSD installations). Then when prompted with an options screen select mirror, chose 2 SSDs and change the partition scheme to GPT (UEFI).

All the rest should be irrelevant, if not let me know.
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: franco on September 16, 2024, 07:52:12 AM
> 'Other Modes'

It's a bit strange: these run unmodified FreeBSD code.


Cheers,
Franco
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: cookiemonster on September 16, 2024, 10:32:29 AM
What would be interesting is to see post install of OPN what the partition tables are for each drive. Sounds like the installer despite being told to use both as a zfs mirror, might be only applying it to one and the boot sequence looking at the other.
Of course if this is unmodified freebsd code that would not happen, as is dealt with by the underlying zfs code, IMHO it would be interesting none the less.
Or, there is missing bootcode for some reason in the partitions.
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: zucca on September 16, 2024, 04:14:57 PM
Can you tell me if SSH is active in the installer?
Or should I use the serial terminal installer?

Goal would be to copy paste here what the commands in terminal/shell respond.

Moreover any (ZFS) commands you want me to run?
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: chemlud on September 16, 2024, 09:30:45 PM
Never tried ssh for install, only serial or VGA console...
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: alien-redfish on September 16, 2024, 11:48:13 PM
I had similar issues with a Lenovo, my fix is at the end of this thread:

https://forum.opnsense.org/index.php?topic=32485.0
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: zucca on September 19, 2024, 03:14:04 AM
Quote from: alien-redfish on September 16, 2024, 11:48:13 PM
I had similar issues with a Lenovo, my fix is at the end of this thread:

https://forum.opnsense.org/index.php?topic=32485.0

Thanks, I could reproduce your fix on my Lenovo as well.
Still it should be no problem to install opnSense in UEFI mode without any workaround, since pfSense and FreeBSD works without any problem.

Quote from: cookiemonster on September 16, 2024, 10:32:29 AM
What would be interesting is to see post install of OPN what the partition tables are for each drive. Sounds like the installer despite being told to use both as a zfs mirror, might be only applying it to one and the boot sequence looking at the other.
Of course if this is unmodified freebsd code that would not happen, as is dealt with by the underlying zfs code, IMHO it would be interesting none the less.
Or, there is missing bootcode for some reason in the partitions.

I can UEFI boot up the opnSense by using the Ventoy USB disk as UEFI "launcher" using the "F4 localboot", see below the option in the bottom:
(https://www.ventoy.net/static/img/vlnk/browser_1.png)

So I tend to think the partitions are structurally somehow right, but for some reasons the PC can't locate the "bootx64.efi" at startup and throw the error "no bootable  os partition , error code 1962".

I have no clue why this is happening, and according to google, I am not the only one.
Mos of the users will just then revert/change boot in legacy and call it the day.

Unfortunately I have no time anymore to dig into it. So this is just to inform the opnSense community that probably there is a bug in the UEFI installation code, or close to it (since it is most likely 1:1 ported from FreeBSD)
 
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: franco on September 19, 2024, 09:25:54 AM
Unfortunately it's a bit too vague to do anything here. It reminds me of the Windows "partition issue" a while back that needed a very special (and silly) workaround in order to allow the OS to not destroy the images when plugged into a Windows by chance:

https://github.com/opnsense/tools/commit/cccd73b43357


Cheers,
Franco
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: zucca on September 20, 2024, 04:29:56 AM
Quote from: franco on September 19, 2024, 09:25:54 AM
Unfortunately it's a bit too vague to do anything here.

Just tell me what to do to provide the necessary details to the UEFI/installation code team.
I am an EE not a SW developer, forgive me.
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: cookiemonster on September 20, 2024, 01:28:55 PM
What's the problem left? Didn't the link provided to use the Lenovo workaround not allowed you to install ?
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: zucca on September 21, 2024, 05:52:16 AM
Quote from: cookiemonster on September 20, 2024, 01:28:55 PM
What's the problem left? Didn't the link provided to use the Lenovo workaround not allowed you to install ?

This entire thread was my kind attempt to report a problem. There is a bug in the UEFI installation process.
I never needed any assistance or help. I am sorry if it was not clear.

I apologize if this forum is not the right place to report bugs, I am new to opnSense.
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: Patrick M. Hausen on September 21, 2024, 08:34:43 AM
The way to report bugs is creating an issue on github.  :)
Title: Re: FreeBSD and pfSense boot, opnSense does not.
Post by: franco on September 21, 2024, 09:41:49 AM
We can also discuss this here, but please be aware most of us are traveling since Wednesday and today and tomorrow there is EuroBSDCon so it's going to be mostly quiet until Monday.


Cheers,
Franco