Solved How to enter the BIOS settings when you boot an operating system with bhyve.

Hello to everyone.

I've just installed Android (DarkMatter version) on the second partition of a virtual disk that I use with bhyve.
On the first partition I've installed Windows 11,because it is necessary to run the setup of Android DarkMatter.
Infact is necessary to run the setup that has been created for Windows. Well,what I did has been :

1) I have created a 200 GB disk
2) on the first 100 GB I have installed Windows 11
3) on the second 100 GB I have installed Android Dark Matter using the setup.exe
4) at some point of the installation it has installed Grub2Win and a bat script that I should run to boot Android. This is the content :

Code:
@echo off
color 0B
mode con:cols=100 lines=15
cls
type "C:\Program Files\DarkMatter\ascii.art"
echo If your PC use *Uefi* then open your BIOS menu.
echo Rebooting in 10 seconds
TIMEOUT /t 9 >nul 2>&1
shutdown /r /f /t 1

As you can read,to boot Android I should open the BIOS menu if I use Uefi. And I'm using Uefi. So,the question is how can I open the BIOS menu using bhyve ? This is the script that I use to boot Windows 11 and I hope,Android :

Code:
/usr/sbin/./bhyve-win -S -c sockets=4,cores=2,threads=1 -m 8G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-hd,/mnt/zroot-133/bhyve/img/Android/DarkMatter.img,bootindex=1 \
-s 8:0,passthru,2/0/0 \
-s 8:1,passthru,2/0/1 \
-s 8:2,passthru,2/0/2 \
-s 8:3,passthru,2/0/3 \
-s 13,virtio-net,tap13 \
-s 29,fbuf,tcp=0.0.0.0:5913,w=1600,h=950,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:13 < /dev/null & sleep 2 && vncviewer 0:13
 
How to boot to BIOS only. Just leave out the image and boot to EDK2 UEFI.

bhyve -s 0,hostbridge -s 31,lpc -l com1,stdio -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd mario
 
I pressed ESC and I entered inside the BIOS. I see only one disk :

Istantanea_2024-09-16_22-06-42.png


Unfortunately from that disk,only Windows 11 is able to boot. But between the BIOS entries,I see the grub2win boot entry. But I don't know how to boot Android from it !

Istantanea_2024-09-16_22-10-11.png
 
You really like beating yourself up. I have ran x86 Android but not virtuilized. Have you any reports of it working?

Read this post about UEFI_VARS. It is in your wheelhouse.

 
It could be true. I like to damage my brain since everytime I choose very hard challenges. But you know,this version of Android is special. To be able to boot it worth the effort...Following the suggestions on the thread,I've ended up using the following line :

Code:
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd,/usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd \

unfortunately it didn't help.
 
Another alternative to try is to install rEFInd on Windows. Maybe this tutorial will help :

 
Back
Top