Booting Haiku-OS inside Qemu seems very buggy

I’d really like to use Haiku-OS, but NOT being a coder, I can report bugs, log errors, etc. but not much I can do to fix any of them.

At present I am focusing on VMs, once it works reproducably on them, I will install on bare metal. Not that I have anything against doing so now, but redoing the setup when something goes wrong, or filing logs or error reports is easier/faster from a VM.

The host is a Debian 12 Bookworm derivative, with the latest Qemu from repositories, 7.2. Used with AQemu GUI.

Have tried R1Beta4, as well as multiple (4-5?) Nightlies, from 57754 to 57801. All install fine, but it would seem the code to make the resulting hard drive image boot (qcow2, and most likely the same used to make a hard drive boot on bare metal), is broken!

All installs boot only with Haiku CD attached, if removed, various flavors of no boot device found errors are generated. I also tried letting it boot from CD, but selecting hard drive as the OS disk by holding down shift, and then once booted from hard drive, executing the makebootable command in terminal on the HD as shown in Drive Setup. No difference. Still won’t boot without CD.

Ready and willing to provide further diagnostic information, hopefully to help pinpoint and eliminate this very bothersome showstopping bug.

Could you join the IRC channel so I can help you there?

I’m on IRC now, in #haiku, as HaikuUser. While I would like to make it work now, for the time being my workaround may suffice. My bigger concern is that it works on both Vms and bare metal in the future, for further installs.

Ahoy,

You had not written which version you installed.

64bit install boot UEFI only. This way need the optical media which contains the EFI partition.
Some stated earlier here he had BIOS way booted Haiku in case 64bit as well. For me it had not worked ever.
So TO RESOLVE THIS …
You must create an esp partition too on your virtual disk.
With Drivesetup give an EFI type active partition. Format to FAT32.

On your install media you would find one,
That size is enough as it is VM will be, so no additional OS and their EFI stuff need that smaller partition.

As that partition is formatted, mount both haiku esp partitions. Copy all directories/files from install media EFI partition to your newly created EFI partition.
Install Haiku to the second - BFS formatted - partition of your virtual disk.

Then comes the real deal. You must look after
EFI boot in QEMU
or
how to select the boot device from a boot device list at boot . I do not know how it works in QEMU.
You should have seen an UEFI part and under the boot device with your EFI partition If your CD is still mounted … that too…
The bootloader binary is under /efi/boot wth .efi extension if you have to browse it with QEMU and set up for loading with UEFI.
Then be aware to select the virtual harddrive’s EFI partition for registering the appropriate bootloader binary, as then the CD needed again if you selected the wromg path.

There are some quemu examples here on the forum, but those are commandline launched ones -not AQEMU lauching ones.

I hope I could help you.
Others may give you a more proper hint/answer to you.

Good luck to install/use Halku successfully!

:cowboy_hat_face:

Thanks for the info. I am using 32 bit (BIOS), so nothing about EFI applies AFAIK. AQemu does show what Qemu command it launches the VM with, it’s in a menu. So I can compare it’s output to commands other people have used for comparison.

As for the installation, you should first initialise the disk, then create a partition on it, then format it as BFS, then close DriveSetup, and select the partition you created in the Installer.

Okidoki, Then I do not know how to resolve. As for 32bit my latest attempt also failed to create a bootable Haiku. It is known issue. There’s a ticket about it.
Unfortunately random occurs, so not pinpointed what cause this.
Some lucky, some not…

Ticket #7930

You may want to add entry in this ticket of your problem, and
also you can up vote the ticket as well.
You can find voting stuff : up above, left off ‘Previous ticket’. For voting you must have logged in, and so this way an account in Trac needed.

Well , in that case … also warn you …

some examples with QEMU here are about

ARM
or
RISC-V

platform emulation as well, as Haiku development happened/happens for those as well.
so devs shared their working configs with early adopters/curios people or other devs.

Have done initialize/partition/format as you suggest.

Thanks, I’ll have a look at that ticket, and add info if I can and it is applicable.

As a general reply to anyone who happens to read this thread, here is my current qemu command: using straight from the terminal, no AQemu or other GUI involved:

/usr/bin/qemu-system-i386 -monitor stdio -machine accel=kvm -m 2045 -cdrom /media/Ext4/haiku-r1beta4-x86_gcc2h-anyboot.iso -hda haiku-R1B4 -net nic -net user -rtc base=localtime -name “Haiku-R1B4”

It so far fails consistently to boot from HD, only CD, and pressing (spamming!) shift during boot to “select” HD as OS disk. As soon as CD is detached, no more booting.

Try formatting the whole disk as BFS instead of initialising it with a intel partition table, sometimes that helps in QEMU.

Thanks, I just read the ticket /KitsunePrefecture linked, it is mentioned in there. And while it may be a reasonable work-around for Qemu, it is horrible to see that it has been kicked down the road 13 years. Not to mention not exactly reasonable on bare metal, where no partition map = no multiple OSes!

Last time I installed Haiku 32-bit on bare metal, I had no problems.
I think that workaround is specific to QEMU.
It seems to be a pretty rare issue, and I am not convinced it is the one you are encountering,
and if you want to install bare-metal, if you have any issues I would recommend you use R1/Beta4 media, and then upgrade to nightly, rather than installing from a nightly media.

I had been using Haiku 32 bit on bare metal since Alpha 1 version (2009), always in multi-OS configuration, and the installation process always worked. This issue is appears only on some specifc cases. Note the comment # 35 in the ticket:

This bug only happens when creating a new partition and forgetting to check the “active partition” checkbox.

About your specific issue, I suggest to try some of the Youtube videos that shows the process to install on Qemu. Probably you are missing some step.

1 Like

I don’t understand why everyone insists on trying makebootable. Makebootable is never needed, Installer already takes care of this part.

The most likely problem is that you don’t have a valid master boot record on your disk. This is written when you do one of these operations:

  • Create a Intel partition table using DriveSetup
  • Use the writembr command
  • Install the boot menu using the corresponding option in Installer

This is intentionally not done automatically, because, if you are setting up Haiku in dual boot with another system, it would erase the bootloader for that other system. So, we have decided to not touch anything by default, and you need some manual steps.

1 Like

I’m glad it worked for you and others and grateful to the developers for everything that does work. But is a comment number 35 (of 40) on a 13 year old bug, in a bug tracker that by the way refuses to log me in the best documentation possible? I think not, so I’m trying to do what little I can to at least document pitfalls (“gotchas”) so no one falls for them in the future.

If there is anything I can do without code to make your comment number 40 (automatically mark first/only partition active in drive setup) a reality, I’d be glad to help!

There is, indeed, an installation guide:

Installation Guide | Haiku Project (haiku-os.org)

Look at the step # 10:

> A panel opens to set the Partition size with the slider at the top. As Partition type choose Be File System and mark it as Active partition. Otherwise it cannot be booted.

Ahoy,

I used to do so, but the failure - mentioned above - had happened against that.
I had a successfully installed 32bit Haiku on bare metal, as Installer stated, but not booted, after reboot. It was BIOS boot, I selected the boot device, and : nothing happened as that was expected. No boot splash, no boot.
I installed onto a USB thumbdrive.

.