Solved Installing freebsd into bhyve legacy bios guest

I'm just trying to install freebsd to an external drive from my freebsd desktop, configure it, and then use that drive on another computer. The requirement is legacy BIOS mode on that installation. And I want to try the native way.

Will this work?
  • boot the MEMSTICK installer (not ISO) usying bhyveload, then
  • install to the target, and then
  • use bhyveload for all post-install boots.
It seems freebsd installer infers UEFI or legacy BIOS mode for the target based on what mode it's booted in? Booting with bhyveload mimicks a real BIOS boot chain, meaning the installer will think it's in BIOS mode, not UEFI, right?
 
Not sure it will work. I *think* you need an ISO file. If I understand your post, you will only have a console, no GUI.
 
Does bhyve even support CSM (legacy BIOS) anymore? The port that provided a legacy BIOS was removed ages ago.
 
bhyveload(8) will present to the VM the same boot chain as legacy BIOS.
Really?!

1. Please explain what a FreeBSD loader inferface has to do with legacy BIOS.

2. Even if loader(8) and by exention byhyveloader(8) was to provide a legacy BIOS interface, why would you need it to provide a legacy BIOS interface? Which it does not BTW. And, FreeBSD works nicely with UEFI. bhyveloader(8) is a quick bypass of the BIOS into loader for FreeBSD VMs (but not Windows or Linux VMs).

3. And if bhyveloader(8) and by extension loader(8), why could I not use bhyveloader(8) to load a legacy BIOS Windows 10 migrated (copied from) a physical disk? The answer is it doesn't provide a CSM (legacy BIOS) interface.

No, bhyveloader(8) does not provide a legacy BIOS interface. It provides a loader(8) interface, which BTW all my UEFI machines also use, i.e. my loader.conf for my UEFI machines is almost exactly the same as my loader.conf for my CSM machines.

You are mistaken.
 
It seems the installer writes boot0, boot1, and boot2 to /boot/ even for UEFI installations.
If the boot code isn't written to the drive or partition, you can use `gpart bootcode` to write it yourself.
Is that what you were looking for?
 
The purpose of my comment was to understand why it matters how the initial installation is done.
If you want the ultimate target system to boot in BIOS, you can not create an EFI System Partition and install the boot code manually on the drive and/or partition.
Am I misunderstanding your problem?
 
Yes, I want my target installation to boot using legacy BIOS, not UEFI. Which is why I think booting with bhyveload will tell the bsdinstaller that the target installation should happen using BIOS and not UEFI method.
 
You can install and configure the system booting with bhyveload and when you're done, you can use that installation on the BIOS system without issue. The rest of the system works the same regardless of how you booted it.
 
I don't need the legacy BIOS interface, I just want to simulate it booted up via non-UEFI for a FreeBSD bhyve VM.
What you are looking for is this. It was deprecated and removed from ports because upstream had stopped supporting the software and archived it. It is abandonware. To use a legacy boot O/S on FreeBSD you must choose one of the other virtualization options such as VirtualBox or qemu. Bhyve does not natively support CSM mode and as I said above the port that adds CSM support was removed.
 
You can install and configure the system booting with bhyveload and when you're done, you can use that installation on the BIOS system without issue. The rest of the system works the same regardless of how you booted it.
bhyveload(8) does not emulate CSM (legacy BIOS). You can use it to boot FreeBSD VMs. It does not support Windows and Linux VMs in CSM mode.

I've tried ll this: to convert a Windows 10 legacy boot physical to a UEFI boot bhyve VM. It worked for 15 minutes after which Windows blue screened. It failed to boot thereafter.

If you're moving a FreeBSD physical with legacy BIOS to bhyve, as stated above bhyveload(8) will work. If you're moving a legacy boot Linux (Fedora) it will probably UEFI boot using grub2. grub2 is smart enough. But you will need to convert the MBR to GPT. It's a simple process.

You cannot migrate a Windows legacy boot physical to bhyve. Windows hard codes certain values in certain files and registry entries. It's been that way since Windows 95.
 
Back
Top