Emulating Haiku in VirtualBox

Virtual instances of operating systems are perfect for all kinds of testing purposes that need to be done in a safe and isolated environment. Installing Haiku in a virtual machine is a solution for people who do not want to install it on their physical computers, but wish to become familiar with it.
This How-To guide will describe the process of running Haiku on virtual machine (VM) using VirtualBox 3.2 There are two ways it can be done– one is installing and running Haiku from CD-ROM image, which is similar to a physical instance. Ror convenience and time-saving purposes, the user may also use the already prepared VM hard disk image. The decision is left up to the user, although many people prefer VM image as it is easier to manage.
For this tutorial we will be using an ISO image and VM image (vmdk) file - both can be obtained here. The VirtualBox virtualization software and installation manual can be downloaded from here.

Go to section:






Installing and running Haiku from an ISO image.

The following guide will describe installation of Haiku with an ISO image on VirtualBox.
Step 1. Creating a virtual machine.
After installing VirtualBox and downloading an ISO image, we can begin the installation process. Installing operating systems in VirtualBox consists of two parts - create a virtual machine and then configure it to run the desired guest system installation.
We begin, by clicking the icon New (or pressing Ctrl + N):
virtualBox's main window
We need to specify what kind of guest operating system we are going to install. This is helpful in the pre-configuration of virtual machines – it applies default settings for supported OS’s. For Haiku, we are going to choose "Other" for operating system type and "Other/Unknown" for version:
VM Name
The next step is to define how much of the host’s physical memory we want to allocate for our virtual machine. This decision should be based on the amount of RAM the host has, but it is recommended to spend a minimum of 256MB of RAM to make it run smoothly. More memory can increase the performance of the VM, but too much can slow down the host, so there needs to be a balance between the VM and host machine resources:
Memory
After we have done that, we need to create a hard disk image, which is going to be stored on the physical drive, at the specified location. We choose Create a virtual harddrive now (if it is not selected already) and click Create:
virtual hard disk
Choose VDI and click Next.
Location and size
Here we can define how big the virtual hard disk should be. In most cases it is sufficient to use the default option, which is Dynamically allocated. This will allow the image file to grow as more content is saved in it, with no lack in functionality:
Hard disk storage type
The next slide will ask us for the location of the hard disk image file and the maximum size of the dynamically expanding file. Input the values and click Create:
Location and size
Step 2. Configuring the virtual machine.
Now we need to configure our new virtual machine: First, click on the Settings icon that appeared for our virtual machine.
Settings on main menu
The settings window allows the user to configure the hardware aspects of the virtual machine that the guest OS will be using. First of all, we need to attach our ISO image with the Haiku installation to the virtual machine in the form of emulated CD-ROM drive. To do that, we choose Storage from the left panel, and then click on Empty in the Storage Tree. Then we click on the CD icon next to the CD/DVD Device drop-down list:
CD/DVD Device
Now we click on Choose a virtual CD/DVD disk file.... In the new window we point to the location where we stored our Haiku ISO image and then click Open to confirm. Here is what we will see after that:
Media manager
After you are done with configuring, click OK to go back to the main window.
Step 3. Installing Haiku
Hopefully, at this point everything is properly configured and we can run the Haiku installation. To do so, click the Start Icon (or Machine -> Start) to run the virtual machine. After a few seconds Haiku's GUI should appear.
The installation itself is quite simple and does not differ really from a physical one (follow the guides on this page if you are not familiar with installing Haiku).
DriveSetup should detect two devices, one is our CD-ROM (ISO) file and another is the “harddrive” we created earlier. All we need to do is select that drive, go to Partitions -> Format, click on Be File System and continue the initialization. Then you use Installer from the Deskbar's appliction menu to install from the CD image to the big virtual harddrive.
Haiku's DriveSetup
And that’s it! Power off and go back to the "Storage" Settings. To prevent booting the ISO image at every bootup, select the ISO image, click on the CD icon to the right and choose Remove Attachment:
Haiku's DriveSetup






Running Haiku from a VM image

The following guide will describe the installation of Haiku in VirtualBox, using a VM hard disk image.
Begin by clicking the icon New (or pressing Ctrl + N).
Main menu
We need to specify what kind of guest operating system we are going to install. This is helpful in the pre-configuration of virtual machines – it applies default settings for supported OS’s. For Haiku, we are going to choose Otherfor operating system type and Other/Unknown for version:
Name and type
The next step is to define how much of host’s physical memory we want to allocate for our virtual machine. This decision should be based on the amount of RAM the host has, but it is recommended to spend a minimum of 256MB of RAM to make it run smoothly. More memory can increase the performance of the virtual machine, but too much can slow down the host, so there needs to be a balance between the virtual machine and host machine resources:
Memory
Now, choose "Use an existing virtual hard drive file" and then browse and select the file you have downloaded:
Add
After the image appears, click Create to confirm and go back to the main window. No further steps or configurations are required to make Haiku work, so we can move straight to executing the virtual machine. Click on the Start icon to boot VM.






Additional steps

Additional Step 1. Configuring the virtual machine.
There are a few settings that could be changed to improve performance of Haiku. Remember that you need to divide resources responsibly, depending on your host specification.
We begin by clicking on the Settings icon.
Settings on main menu
The settings window allows the user to configure the hardware aspects of the virtual machine guest OS will be using.
One of the ways to increase performance is changing the video memory assigned to the virtual machine. On the left panel click Display tab, and move the first slider to the right, to increase the amount of memory assigned. This should allow the GUI to run more smoothly and be more responsive.
Display tab
By default, mouse integration with the guest is disabled in VirtualBox. However, we can easily enable this convenient feature:
Go to the System tab under Settings and change Pointing Device to USB Tablet.
unmount
After you are done with configuring, click OK to go back to the main window.
Additional Step 2. Adjusting window settings.
One of the inconveniences users experience while using virtual machines is screen resolutions. By default, guest OS’s apply a big screen resolution, causing the windows to have scrolling bars on both sides to navigate in x-axis and y-axis. There are two solutions for that problem.
First solution is simply adjusting the screen resolution using tools built into system. In Haiku we can use the Screen preflet, which can be found under the Preferences menu. By changing the resolution the user will then notice that size of the VM window has now changed.
Haiku's Screen Preflet
The other way is to resize the guest window through the host. While Virtual Guest Additions are available from HaikuDepot, there is no automatic window resizing support yet. However the user may use custom VESA resoultion as a workaround.
For example, type this in your host system:
VBoxManage setextradata "VM name" "CustomVideoMode1" "1400x1050x16"
Additional Step 3. Using a bigger VM hard disk image.
Often users find the size of original VM Haiku image not big enough to fulfill their needs. Just like a regular hard drive, once created, its physical boundaries cannot be expanded any more (the size of the disk, not partitions). The solution is to reinstall the system into a bigger VM image.
First, we need to add a new hard disk image in the Storage section of the Settings menu:
add virtual hard disk
Define the settings for the new hard disk image (most people will use a dynamically allocated VDI image) and click Create.
new disk setting
We begin the process by starting the VM. Installing onto the newly created bigger harddisk is quite simple and does not differ really from a physical one (follow the guides on this page if you are not familiar with installing Haiku).
DriveSetup should detect two devices, one is our original small harddisk and the other is the big new harddrive we created earlier. All we need to do is select that big drive, go to Partitions -> Format, click on Be File System and continue the initialization.
Haiku's DriveSetup
Then you use Installer from the Deskbar's appliction menu to install from the small original harddrive to the big virtual disk:
install target
Once we are done, we can turn off the VM and unmount the old image:
unmount
After the process is completed, we can delete the old, smaller hard drive VM image, and boot the new one we have just created.






Troubleshooting

1. Haiku cannot connect to the internet
There are some known issues with the network cards on VirtualBox virtual machines. The symptom is simply the inability to connect to other computers over the Internet. A solution to this problem is as follows:
Go to the settings of Haiku virtual machine (it needs to be shutdown first) and click Network -> Advanced-> Adapter type -> Intel PRO/100 MT. Accept changes by clicking OK.
Intel PRO/100 MT
Now the network services should be working properly.
2. The VirtualBox Guest Additions are incomplete
The VirtualBox Guest Additions provide drivers for the guest system so it may communicate with the host with simpler protocols. This could be desirable as it will provide additional features such as shared clipboards. However, this is not a necessary component of a VM, and Haiku will run perfectly fine without or only the available limited Guest Additions installed.