Trying to boot ReactOS with bhyve on FreeBSD 14...

Ask your support questions in here

Moderator: Moderator Team

mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

Hello to everyone.

I would like to boot ReactOS using the bhyve hypervisor on FreeBSD 14. To achieve this goal I'm in contact with a bhyve developer. He's helping me to achieve this goal. This is what he suggested to do before all :
There should be a /usr/local/share/uefi-firmware/BHYVE_UEFI_CSM_CODE.fd file or something like that. iirc, it's included in the bhyve-uefi-edk2-csm package. Note that it's an old version of OVMF and may not
work properly.

Unfortunately, afaik CSM doesn't work on newer OVMF version. It's even more worse. Latest upstream EDKII completely removed CSM support from OVMF.

An alternative would be using seabios as bootrom. However, it's highly qemu specific. seabios is no big project but it will take several weeks to port it to bhyve.
Ok,this is what I tried to do. Unfortunately it does not work. ReactOS frozen itself on the boot screen :

[ external image ]

anyway,from this webpage :

https://reactos.org/wiki/User:Illen/UEFI_Boot

I can read :

Quibble is an open source UEFI Windows loader, it supports Windows XP and later and recently became capable of booting ReactOS as well...

so,I want to try to follow that instructions and hope that bhyve can detect the suggested techniques as good ones. But I'm unlucky even on this case because there are a lot of broken links on the page :

http://openfire-ros.duckdns.org/nextclo ... otia32.efi = not found

On the "Longhorn winload" section there are also broken links :

http://openfire-ros.duckdns.org/nextclo ... wnload/bcd = not found

On the "UEFI Boot on AMD64" section there are broken links :

http://openfire-ros.duckdns.org/nextclo ... ootx64.efi = not found

Furthermore,you say :
To prepare ReactOS for booting with AMD64 winload, you need to uncomment this and this. Now build a LiveCD
I should build a LiveCD,ok but following which procedure ? it is not specified.

So,the documentation is not updated,with broken links and parts that haven't been explained. I'm not able to perform further steps. I need to acquire more informations and more stuff and more help from you before to start making some experimentation.
The_DarkFire
Posts: 8
Joined: Sun Feb 14, 2021 4:08 am

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by The_DarkFire »

Hi! I’m the developer implementing UEFI class 3 support into reactos.

The good news is you CAN get to desktop
https://github.com/DarkFire01/reactos/tree/Desktop-UEFI

You’re going to have to build and amd64 iso of this branch.
A hybridcd specifically .
Follow the Amd64 build instructions with MSVC,
But instead of “ninja livecd”
Etc

Use
“ninja hybridcd”

If you run into help, our Mattermost is a great place to get in contact with me.
Otherwise, I’ll try to build and ISO sometime today and post to this forum



Now for the bad news,
You can boot this yes.
But it won’t do anything except reach desktop.

Hardware initialization doesn’t occur on UEFI due to missing arbiter support.
mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

ok. So,what ? is it a wasting of time ? if the "arbiter support" is missing,nothing will work ? So,am I forced to boot it in BIOS mode ?
mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

Hello.

I've installed this BE :

https://downloads.sourceforge.net/react ... -2.2.1.exe

and then I did :

Code: Select all

git clone https://github.com/reactos/reactos
cd reactos
configure.cmd
cd output-MinGW-i386
ninja hybridcd
It has produced the iso file called hybridcd.iso. I tried to boot it with bhyve like this :

Code: Select all

bhyve -S -c sockets=2,cores=2,threads=2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-cd,/home/marietto/Downloads/OS/Windows/ReactOS/hybridcd.iso,bootindex=1 \
-s 11,hda,play=/dev/dsp,rec=/dev/dsp \
-s 13,virtio-net,tap8 \
-s 29,fbuf,tcp=0.0.0.0:5908,w=1600,h=950,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:8 < /dev/null & sleep 2 && vncviewer 0:8
Unfortunately it won't boot :

https://ibb.co/TMxC0Vm
Illen
Posts: 56
Joined: Mon Feb 20, 2017 7:12 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by Illen »

mariozio wrote: Thu Apr 11, 2024 6:23 pm So,the documentation is not updated,with broken links and parts that haven't been explained. I'm not able to perform further steps. I need to acquire more informations and more stuff and more help from you before to start making some experimentation.
This is not official documentation, but my own page which has information about testing ReactOS with 3rd-party UEFI Windows bootloaders. This is not meant for any practical usage, it's just for testing. Sorry for dead links anyway, I replaced those that I could with archived ones.
mariozio wrote: Thu Apr 11, 2024 8:46 pm ok. So,what ? is it a wasting of time ? if the "arbiter support" is missing,nothing will work ? So,am I forced to boot it in BIOS mode ?
It means that the hardware (even essential such as input devices) will not work and you may not be able to interact with system in any way.
mariozio wrote: Sat Apr 13, 2024 4:50 pm -s 11,hda,play=/dev/dsp,rec=/dev/dsp \
ReactOS doesn't support HD Audio out of the box. If you want sound in guest, use AC'97 instead. I am not sure if bhyve supports emulation of AC'97 though.
mariozio wrote: Sat Apr 13, 2024 4:50 pm -s 30,xhci,tablet \
ReactOS doesn't support xHCI USB controllers. Use OHCI, UHCI, or EHCI controller instead. I am not sure if bhyve supports emulation of those though.
mariozio wrote: Sat Apr 13, 2024 4:50 pm -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
Is that BHYVE_UEFI_CODE.fd 32 bit UEFI firmware? It appears as if you tried to boot 32 bit hybridcd image on 64 bit firmware, which is not supported. Either use 32 bit UEFI firmware or build 64 bit ReactOS image instead.
mariozio wrote: Sat Apr 13, 2024 4:50 pm git clone https://github.com/reactos/reactos
You were suggested to use a branch with experimental UEFI related patches instead, did you miss it?
https://github.com/DarkFire01/reactos/tree/Desktop-UEFI
mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

---> Is that BHYVE_UEFI_CODE.fd 32 bit UEFI firmware?

nope.

---> Either use 32 bit UEFI firmware or build 64 bit ReactOS image ...

can you explain how to build 64 bit ReactOS image ?

---> You were suggested to use a branch with experimental UEFI related patches instead, did you miss it ?

Sorry,yes.
Last edited by mariozio on Sun Apr 14, 2024 10:12 am, edited 1 time in total.
mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

It did not compile correctly. I've launched "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit &'C:\RosBE\RosBE.ps1' amd64"

this is what happened :

Code: Select all

wget https://github.com/DarkFire01/reactos/archive/refs/heads/Desktop-UEFI.zip
cd Desktop-UEFI
charch amd64 (as explained here : https://reactos.org/wiki/A_Layman%27s_Guide_-_How_to_Compile_ReactOS)    
.\configure.cmd
cd output-MinGW-amd64
ninja hybridcd
.....
[203/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_1257.c.obj
[204/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_861.c.obj
[205/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_862.c.obj
[206/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_863.c.obj
[207/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_860.c.obj
[208/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_864.c.obj
[209/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_865.c.obj
[210/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_874.c.obj
[211/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_866.c.obj
[212/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_875.c.obj
[213/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_869.c.obj
[214/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_878.c.obj
[215/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_932.c.obj
[216/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/cptable.c.obj
[217/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/mbtowc.c.obj
[218/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_950.c.obj
[219/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/compose.c.obj
[220/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_949.c.obj
[221/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/casemap.c.obj
[222/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/string.c.obj
[223/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/c_936.c.obj
[224/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/wctomb.c.obj
[225/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/utf8.c.obj
[226/299] Building C object sdk/tools/unicode/CMakeFiles/unicode.dir/wctype.c.obj
[227/299] Building C object sdk/lib/inflib/CMakeFiles/inflibhost.dir/infhostget.c.obj
[228/299] Building C object sdk/lib/inflib/CMakeFiles/inflibhost.dir/infhostput.c.obj
[229/299] Building C object sdk/lib/3rdparty/zlib/CMakeFiles/zlibhost.dir/adler32.c.obj
[230/299] [FLEX][pp_scanner] Building scanner with flex 2.6.4
[231/299] Building C object sdk/lib/inflib/CMakeFiles/inflibhost.dir/infhostrtl.c.obj
[232/299] Building C object sdk/tools/xml2sdb/CMakeFiles/xml2sdb.dir/__/__/__/dll/appcompat/apphelp/sdbwrite.c.obj
[233/299] Building CXX object sdk/tools/gcc_plugin_seh/CMakeFiles/gcc_plugin_seh.dir/main.cpp.obj
FAILED: sdk/tools/gcc_plugin_seh/CMakeFiles/gcc_plugin_seh.dir/main.cpp.obj
C:\RosBE\i386\bin\c++.exe  -DTARGET_amd64 -D_CRT_NON_CONFORMING_SWPRINTFS -D__REACTOS__ -D__RELFILE__="&__FILE__[__FILE__[0] == '.' ? 9 : 24]" -Dgcc_plugin_seh_EXPORTS -Isdk/tools/gcc_plugin_seh -I../../../sdk/tools/gcc_plugin_seh -I../../../sdk/tools/gcc_plugin_seh/plugin/include -g   -std=gnu++11 -MD -MT sdk/tools/gcc_plugin_seh/CMakeFiles/gcc_plugin_seh.dir/main.cpp.obj -MF sdk\tools\gcc_plugin_seh\CMakeFiles\gcc_plugin_seh.dir\main.cpp.obj.d -o sdk/tools/gcc_plugin_seh/CMakeFiles/gcc_plugin_seh.dir/main.cpp.obj -c ../../../sdk/tools/gcc_plugin_seh/main.cpp
../../../sdk/tools/gcc_plugin_seh/main.cpp:8:10: fatal error: gcc-plugin.h: No such file or directory
 #include <gcc-plugin.h>
          ^~~~~~~~~~~~~~
compilation terminated.
[234/299] [BISON][pp_parser] Building parser with bison 3.5.4
[235/299] Building C object sdk/lib/cmlib/CMakeFiles/cmlibhost.dir/cminit.c.obj
[236/299] Building C object sdk/tools/xml2sdb/CMakeFiles/xml2sdb.dir/__/__/__/dll/appcompat/apphelp/sdbstringtable.c.obj
[237/299] Building C object sdk/lib/cmlib/CMakeFiles/cmlibhost.dir/cmcheck.c.obj
[238/299] Linking C static library sdk\tools\unicode\libunicode.a
[239/299] Building C object sdk/lib/cmlib/CMakeFiles/cmlibhost.dir/cmheal.c.obj
[240/299] Building CXX object sdk/tools/xml2sdb/CMakeFiles/xml2sdb.dir/main.cpp.obj
[241/299] Building CXX object sdk/tools/xml2sdb/CMakeFiles/xml2sdb.dir/tinyxml2.cpp.obj
[242/299] Building CXX object sdk/tools/xml2sdb/CMakeFiles/xml2sdb.dir/xml2sdb.cpp.obj
ninja: build stopped: subcommand failed.
ninja: build stopped: subcommand failed.
PS C:\reactos-Desktop-UEFI\output-MinGW-amd64>
Last edited by mariozio on Sun Apr 14, 2024 6:51 pm, edited 1 time in total.
The_DarkFire
Posts: 8
Joined: Sun Feb 14, 2021 4:08 am

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by The_DarkFire »

Hi building MSVC doesn't involve rosbe at all. it's a unique process
https://reactos.org/wiki/Building_ReactOS

But I built an ISO for you anyway.
Please choose either
LiveCD in RAM (Debug)
or
LiveCD in RAM (Screen)
on this cd if this still not able to boot tell me more about your configuration and itll try to debug it myself sometime soon.

here's the link
https://drive.proton.me/urls/D410X56Y78#iJ41GxH2O0su
mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

It has booted,but it gives an error for the scsi driver. These are the parameters that I've used :

Code: Select all

bhyve -S -c sockets=2,cores=2,threads=2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-cd,/home/marietto/Downloads/OS/ReactOS/reactOS_UEFI_BOOT.iso,bootindex=1 \
-s 29,fbuf,tcp=0.0.0.0:5908,w=1600,h=950,wait \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:8 < /dev/null & sleep 2 && vncviewer 0:8
on this link you find the screenshots that I've taken for each type of boot that I've tried :

https://drive.google.com/file/d/1AuW9p7 ... sp=sharing

I think the error is caused by a mismatch error with "ahci-cd" ; you think that it needs a scsi driver,but it does need another driver,I presume.
mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

The_DarkFire wrote: Sun Apr 14, 2024 8:49 pm Hi building MSVC doesn't involve rosbe at all. it's a unique process
https://reactos.org/wiki/Building_ReactOS
To compile it by myself I tried the procedure below (without RosBE) ,but it seems that it wants it :

Code: Select all

wget https://github.com/DarkFire01/reactos/archive/refs/heads/Desktop-UEFI.zip
cd Desktop-UEFI
configure.cmd
unable to detect build environment. configure script failure.
can you write me the commands to issue to compile it ? thanks. I need to learn how to compile it,because when I will be able to reach the desktop,I want to customize it a little bit,since I need it to accomplish a project with FreeBSD (that I have explained to you in a private message).
User avatar
EmuandCo
Developer
Posts: 4742
Joined: Sun Nov 28, 2004 7:52 pm
Location: Germany, Bavaria, Steinfeld
Contact:

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by EmuandCo »

It wants you to run this off the MSVC 2022 console. This way you don't proviode ANY compiler at all.
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.

If my post/reply offends or insults you, be sure that you know what sarcasm is...
mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

Please can you point me to the correct part of the instructions where it is well explained what should I do ? I have some troubles to understand where is the section of the instructions that I should follow.
Illen
Posts: 56
Joined: Mon Feb 20, 2017 7:12 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by Illen »

mariozio wrote: Sun Apr 14, 2024 10:40 pm I think the error is caused by a mismatch error with "ahci-cd" ; you think that it needs a scsi driver,but it does need another driver,I presume.
ReactOS uses UniATA driver (which is a scsiport miniport) for AHCI support. It appears that the scsiport driver crashes for some reason. This is possibly due to hardware initialization problem, which is due to lack of arbiter as already mentioned above. ReactOS is known to boot on some UEFI Class 3 systems using the UEFI branch, but in most cases it would boot from RAM disk rather than any actual hardware disk. Using virtio-scsi instead of ahci may help with working around the scsiport.sys driver failure. Alternatively you can exclude scsiport and the drivers that depend on it (uniata, buslogic) during build by commenting out the "add_cd_file(...)" line in respective CMakeLists.txt files. Keep in mind that only the "RAM" options could work if you do any of the above.
mariozio wrote: Mon Apr 15, 2024 10:09 am Please can you point me to the correct part of the instructions where it is well explained what should I do ? I have some troubles to understand where is the section of the instructions that I should follow.
https://reactos.org/wiki/Building_ReactOS#Windows/MSVC
mariozio
Posts: 17
Joined: Thu Apr 11, 2024 6:02 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by mariozio »

Regarding the questions that you have asked me :

> ReactOS doesn't support HD Audio out of the box. If you want sound in
> guest, use AC'97 instead. I am not sure if bhyve supports emulation
> of AC'97 though.

bhyve supports only HD Audio.

> ReactOS doesn't support xHCI USB controllers. Use OHCI, UHCI, or EHCI
> controller instead. I am not sure if bhyve supports emulation of
> those though.

bhyve support only xHCI.

> Is that BHYVE_UEFI_CODE.fd 32 bit UEFI firmware? It appears as if you
> tried to boot 32 bit hybridcd image on 64 bit firmware, which is not
> supported. Either use 32 bit UEFI firmware or build 64 bit ReactOS
> image instead.
>

BHYVE_UEFI_CODE.fd is 64 bit firmware.

Keeping in consideration that I don't need to install ReactOS physically on a disk,but as a virtual machine,I think to be able to fix some of the incompatibilities between reactOS and bhyve. For example :

--> bhyve supports only HD Audio.

I don't know for sure,but I think that I could forward/share the sound/device /dev/dsp between the host and the guest using Xpra or a similar tecnique.

--> bhyve support only xHCI.

ReactOS does not support xHCI,ok. I think to be able to move mouse and to use keyboard using a little tool called "barrier". It shares mouse and keyboard from the host to the guest. For sure I should setup the server on FreeBSD and the client on ReactOS and I think it will work even if the arbiter does not work on ReactOS. At least this is my hope :D ; otherwise maybe I can do the same using USBIP....

---> BHYVE_UEFI_CODE.fd is 64 bit firmware.

this is not a problem,since I see that I can compile the 64 bit version of ReactOS.
Illen
Posts: 56
Joined: Mon Feb 20, 2017 7:12 pm

Re: Trying to boot ReactOS with bhyve on FreeBSD 14...

Post by Illen »

mariozio wrote: Mon Apr 15, 2024 12:37 pm Keeping in consideration that I don't need to install ReactOS physically on a disk,but as a virtual machine,I think to be able to fix some of the incompatibilities between reactOS and bhyve. For example :
Depending on the USB/HDA devices that bhyve emulates, you can also look for 3rd party driver for Windows 2000/XP/2003 which supports those devices.
mariozio wrote: Mon Apr 15, 2024 12:37 pm I don't know for sure,but I think that I could forward/share the sound/device /dev/dsp between the host and the guest using Xpra or a similar tecnique.
Depending on the method you use for that, it still would need either the driver for the host device that you passthrough to the guest, or the driver for guest device specific to the VM that works with Windows 2003/ROS. Linux/Unix specific methods aren't going to work either.
mariozio wrote: Mon Apr 15, 2024 12:37 pm ReactOS does not support xHCI,ok. I think to be able to move mouse and to use keyboard using a little tool called "barrier". It shares mouse and keyboard from the host to the guest. For sure I should setup the server on FreeBSD and the client on ReactOS and I think it will work even if the arbiter does not work on ReactOS. At least this is my hope :D ; otherwise maybe I can do the same using USBIP....
That is assuming you can get any connection with host working, be it through network or even COM...
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest