Running Haiku Release 1 Alpha 4.1 in VirtualBox 4.2

Blog post by agmsmith on Thu, 2012-12-20 00:15

I've had some time to play around with Haiku R1A4.1 and got it working nicely in VirtualBox, running under Windows, and also on real hardware. Along the way I made a few notes (InstallingHaikuR1A4.html) on how to get it going. I'll describe the significant things you need to know in the rest of this blog post.

The existing tips and instructions (search for Blog tag "virtualbox") are still useful, however after the problems I had with R4A1's hard drive IDE controller support, the main change to the Haiku VirtualBox Instructions page is to set up the virtual hard drive controller in AHCI mode. I was able to boot a SATA drive on real hardware in IDE-Enhanced mode (before I switched the BIOS to AHCI), but I didn't test it much.

As well, I was able to get the virtual machine to use a real disk with Windows 7 as the host OS. It's tricky, and requires a second disk drive since Windows 7 security prevents you from writing sectors to the boot drive. The VirtualBox documentation describes it well enough, and you do need to run VirtualBox with the "Run as administrator" option in Windows. However, once it's working, it's quite convenient for building Haiku in the VM, copying it to the real drive, and then rebooting to run it on the real hardware.

There are also some problems with getting Haiku disk partitions to boot in VirtualBox, but if you use the BootManager instead of the old MSDOS style MBR boot loader, it will work. I assume GRUB and other modern bootloaders will similarly work.

I still have to try the VirtualBox Guest Additions for Haiku, but it works well enough without them.

I did have to tell VirtualBox that my display could do 1080p video (you can add your own VESA video modes), and Haiku then picked it up in its screen preferences. Pity I can't do that with the real hardware - the monitor shows up as only 1400x1050.

Meanwhile, I should get back to fixing up VNC to work in Haiku - currently it mostly works but crashes when the screen resolution changes.


Re: Running Haiku Release 1 Alpha 4.1 in VirtualBox 4.2

Is there any binaries for the additions available yet?

Re: Running Haiku Release 1 Alpha 4.1 in VirtualBox 4.2

Unfortunately not. Hopefully someone creates an optional package... However, I uploaded them here:

Re: Running Haiku Release 1 Alpha 4.1 in VirtualBox 4.2

Thanks for the upload, something to try if my compiling attempts fail. I've downloaded the current VirtualBox source code and will try tomorrow to compile those guest additions against Haiku R1A4. Though I see comments that it may only compile for GCC4, not the GCC2 of a stock Haiku distribution.

Building VirtualBox 4.2 Guest Additions for Haiku

Well, that didn't work. Got the source easily enough using Subversion, using "svn checkout VirtualBox". After adding the path to the tools the VirtualBox build system uses (conveniently pre-compiled in VirtualBox/kBuild/bin/haiku.x86/), and figuring out that the command to build the VirtualBox guest additions is "VBOX_ONLY_ADDITIONS=1 kmk" run from the VirtualBox/src directory, and that you need to do "setgcc x86 gcc4" before compiling, I got a tough compile error. Apparently VirtualBox/src/libs/kStuff/kStuff/include/k/kDefs.h doesn't include a Haiku definition.

I'll now try to see if the precompiled guest additions from last year work in Haiku R1A4. But first I need to build a GCC4 based Haiku. Maybe it also needs the GCC4 Haiku to do the build? More later when I have time...

Re: Building VirtualBox 4.2 Guest Additions for Haiku

Re: Building VirtualBox 4.2 Guest Additions for Haiku

Thanks for the HaikuPorter suggestion from however it still doesn't work. When HaikuPorter ran the ./configure script, didn't recognise the OS. I manually ran the commands on a newer version of the source obtained from SVN, and ./configure recognised Haiku but stopped with a complaint about a missing IASL compiler (which theoretically could be built from the source code Intel provides). I got it to go further by using ./configure --build-headless --disable-python --disable-java --nofatal, which was good enough to get to the actual compilation started with kmk VBOX_ONLY_ADDITIONS=1 VBOX_WITH_ADDITION_DRIVERS=1 VBOX_USE_GCC4=1 all That then failed with the same problem I had before in kDefs.h. Looks like a little bit of source code fixing is actually needed.

Re: Running Haiku Release 1 Alpha 4.1 in VirtualBox 4.2

Thanks - the mouse pointer integration does work. I wasn't able to get the shared folder working, and it does crash when you shutdown Haiku. Needs a bit more work...

Re: Running Haiku Release 1 Alpha 4.1 in VirtualBox 4.2

In BeOS I used to play around with the screen config file, this not only let me select different screen resolutions but also create scrollable virtual screens that were far larger what the monitor was capable of displaying in one go.

I believe the largest virtual display I created was 3.5K by 2.75K and always wondered if I had a card with more memory if I could create 4K by 4K?

It was useful Google Maps and other maps large graphic files.

PS. 4K by 2K did not work, so I don't know what the real limits were.