Installing from a Raw Image

If you can't or don't want to go through building from source, you can also install an already built image. You'll have to download a raw image for that, not a VMWare image. Note that these are test images, they are not complete distributions that include a lot of software, both to keep the size and complexity of building them down.

# Installing on a partition

After you have downloaded the raw image, you need to get this image to the partition or medium you intend to install it to. Under BeOS, Linux or basically everything except Windows you can use dd to just copy it over, using the partition or drive as a target.

Under BeOS to partition X on the master on the first channel:

    dd if=/path/to/image of=/dev/disk/ide/ata/0/master/X

Under BeOS to the raw slave on the first channel (overwriting the MBR):

    dd if=/path/to/image of=/dev/disk/ide/ata/0/master/raw

Under Linux to partition X on the first hard disk:

    dd if=/path/to/image of=/dev/hdaX

Make extra sure that you have the right partition picked there, as these commands are destructive. Recheck with a partitioning tool to verify for example. Note that you'll probably need administrative rights under Linux, so use sudo or su to execute these commands.

If you want to put the image at the absolute start of the drive (so that you don't need an additional boot manager), make sure that you write to the whole raw drive and not to a partition. You do that by specifying a raw device instead of a partition. Under Linux you would for example omit the partition number resulting in `sdb` instead of `sdb1`. Under BeOS you would pick the .../raw path instead of one with a number. If you use such a command, you overwrite the MBR containing the partition table. This means, that all the partitions on that drive will become inaccessible (not only the first part of the drive). So be sure that you want to do such a destructive operation!

Under Windows things are sadly a bit more complicated. You can try dd for Windows or use a tool like Flashnul to get the image to a partition or USB drive. You should find the tools on the Internet, go back to the USB section to learn how to use Flashnul to copy a Haiku image.

Note that when you just copy over an image to a partition or drive, you won't be able to use the full size of the target partition/drive. The image was built with a certain size (256MB currently) which is the size of the filesystem inside the image. So there's no real point in making a 10GB partition available for it, it won't be usable.

# Copying the contents of a pre-built image

Instead of copying the image itself you can also make a separate BFS partition yourself and then copy over the contents of the image to that partition. You will need a platform supporting BFS to do that obviously, which leaves you with two possible options. Either you use a version of BeOS to do the setup with DriveSetup or mkbfs or you use Haiku itself with Installer or DriveSetup.
Once you've created and initialized the target partition you can mount the image (using tools like Mount Image or through the Terminal) and copy over all the files. If you are under Haiku, you can just as well use Installer to make a duplicate of your currently booted installation.

# Making it bootable

When you just create a plain partition and initialize it to a BFS filesystem or if you copy over a complete Haiku image, this doesn't necessarily make the partition bootable. The partition boot record may be missing, or the partition offset could be misconfigured. The prebuilt images for example contain a partition offset of 0 for example, since they are not actually partitioned. They only consist of a direct BFS filesystem, so the offset to that is 0. This will work in exactly one case, where you don't actually put it into a partition. If you for example copy such an image directly to a USB drive starting from 0, overwriting the MBR (destroying all partitions already there), then this will boot. If you however copy an image to the first partition on your hard disk, this will not work out of the box, as the boot code in the partition boot record won't find the desired filesystem at offset 0 (that's where the MBR still is).

To make sure a partition boot record is there and it contains the right partition offset, you can use the tool makebootable. It will do both, write the partition boot code to the beginning of the partition and detect and write the partition offset to where it is needed. You can use the makebootable from BeOS if you have a BeOS installation that has access to the partition in question. To do that, mount the volume you have Haiku installed to and use:

    makebootable /HaikuMountpoint

Where /HaikuMountpoint is where you have mounted your Haiku volume to. Note that the BeOS' makebootable can be used, because the partition boot record does only load the zbeos boot loader. As Haiku does provide a zbeos as well and there is no information passed from the partition boot code to the boot loader, this is compatible between BeOS and Haiku and you can use a BeOS' makebootable with a Haiku boot loader and the other way around.

If you already have some Haiku medium capable of booting Haiku (like a USB drive) you could also boot into Haiku and run makebootable from there. Note that there is currently a bug that will require you to run it from the location it resides in like so:

    cd /bin
    makebootable /MountpointOfNewHaikuInstallation

If you are on Linux or another build platform that has support for makebootable and have the sources available you can run:

    jam run ":<build>makebootable" /dev/sdaX

Where the /dev/sdaX is the partition that is supposed to be made bootable. Under Windows this is currently not possible.

# Configuring the boot manager

When the partition itself is bootable, i.e. contains a partition boot record and the correct partition offset, there needs to be a way to get it executed. If you use a boot manager like GRUB, you need to instruct it to load from that partition. You do that for GRUB by adding an entry to its menu.lst usually located at /boot/grub/menu.lst. The following would instruct it to switch to the partition and then just chainload the partition boot record:

    title Haiku
    rootnoverify (hd0,3)
    chainloader +1

That would work if you installed to disk "0" and partition "3". Note that the GRUB naming is one-off the Linux one, so if you have it installed to /dev/sda4 that would translate to disk "0" (sda == 0, sdb == 1, ...) and partition "3" (4 - 1).

In case you are using the BeOS boot manager, just re-run the bootman command and add the new Haiku partition to the boot menu.

If you have another boot manager consult its documentation on how to chainload partitions, most should support such a thing, possibly named a bit different. In doubt just add an entry for the partition, probably this will cause it to chainload, even if not explicitly named so.