LOGO

Multi-Boot Raspberry Pi with BerryBoot - A Simple Guide

March 21, 2013
Multi-Boot Raspberry Pi with BerryBoot - A Simple Guide

Streamlining Your Raspberry Pi Boot Process with BerryBoot

For Raspberry Pi enthusiasts seeking to maximize their project time, the BerryBoot multi-boot manager offers a significant advantage. It drastically reduces the time spent switching between SD cards, enabling seamless operation of multiple operating systems from a single card.

What is BerryBoot?

BerryBoot is a versatile tool designed to simplify the process of booting various operating systems on your Raspberry Pi. Instead of requiring separate SD cards for each OS, it consolidates them onto one, streamlining your workflow.

Installation Guide

The installation process is straightforward and user-friendly. We will guide you through each step to ensure a smooth setup.

First, download the latest version of BerryBoot from its official source. Ensure the download is compatible with your specific Raspberry Pi model.

Next, extract the downloaded archive. This will reveal a set of files necessary for the installation procedure.

Then, copy all the extracted files directly onto a formatted SD card. The SD card should be formatted with a FAT32 file system.

Insert the SD card into your Raspberry Pi and power it on. The Pi will then boot into the BerryBoot configuration interface.

Configuring BerryBoot

Within the BerryBoot interface, you can select and install the operating systems you desire. A network connection is required to download the OS images.

BerryBoot supports a wide range of operating systems, including various Linux distributions and even Windows 10 IoT Core.

Once the operating systems are downloaded and installed, you can choose which one to boot each time you power on your Raspberry Pi.

Benefits of Using BerryBoot

  • Simplified OS Management: Easily switch between operating systems without physically swapping SD cards.
  • Space Efficiency: Consolidate multiple OS installations onto a single SD card.
  • Ease of Use: The intuitive interface makes installation and configuration simple.
  • Flexibility: Supports a diverse range of operating systems.

By utilizing BerryBoot, you can significantly enhance your Raspberry Pi experience, dedicating more time to experimentation and project development.

The Advantages of Utilizing BerryBoot

BerryBoot represents a powerful boot management solution specifically designed for the Raspberry Pi, significantly enhancing its versatility. Its primary advantage lies in the capability to boot multiple operating systems from a single SD card.

Users have the flexibility to store these operating systems directly on the SD card itself. Alternatively, for expanded storage capacity, BerryBoot can be configured to utilize the SD card solely as a bootloader, executing the operating systems from a connected hard drive.

Simplified Operating System Management

The BerryBoot configuration utility streamlines the process of acquiring additional, Raspberry Pi-optimized distributions. Currently, BerryBoot incorporates the following Pi-compatible distributions:

  • BerryWebserver (a bundle featuring Lighttpd, PHP, and SQLITE for web serving)
  • Berry Terminal (an LTSP/Edubuntu-based thin client solution)
  • Raspbian (based on Debian Wheezy)
  • MemTester (a memory testing tool)
  • OpenElec (a dedicated media center software package)
  • Puppy Linux (a lightweight Linux distribution)
  • RaspRazor (an unofficial Raspbian fork, rich in programming utilities)
  • Sugar (the operating system originally developed for the One Laptop Per Child initiative)

Beyond these pre-integrated options, the system allows for the inclusion of custom Linux distributions. This can be achieved by downloading pre-optimized images or by converting existing distributions to the SquashFS format for seamless integration into BerryBoot.

BerryBoot offers a compelling solution for Raspberry Pi enthusiasts seeking to explore a diverse range of tools and operating systems. It eliminates the need for multiple SD cards, the associated labeling, tracking, and frequent swapping, ultimately maximizing the Pi’s potential with minimal additional effort.

Essential Requirements

To begin, you will require a Raspberry Pi device, the necessary accompanying hardware, and a stable internet connection. It is highly recommended to review our guide, The HTG Guide to Getting Started with Raspberry Pi, to ensure you possess a foundational understanding of the system.

This includes verifying you have a sufficient power supply and familiarity with the initial configuration of Raspbian.

Beyond the hardware prerequisites detailed in the aforementioned tutorial, a specific file must be downloaded from the BerryBoot repository.

  • The BerryBoot Installer

Initiate the process by extracting the contents of the downloaded BerryBoot Installer .ZIP archive onto an SD card formatted with the FAT file system.

This SD card will serve as the central hub for your multi-boot configuration.

Setting Up BerryBoot

After downloading the installer and extracting its files onto your SD card, the setup process can begin. Insert the SD card into your Raspberry Pi and connect the power supply to initiate booting. A brief startup sequence will occur, leading you to the configuration wizard’s graphical user interface.

how-to-multi-boot-your-raspberry-pi-with-berryboot-1.jpg

Take time to adjust the video output settings. Choose whether to enable or disable overscan, depending on whether green calibration bars appear at the screen’s top and bottom. Configure your network connection, selecting either a wired or Wi-Fi option. Finally, customize your locale and keyboard preferences.

Should you choose Wi-Fi, you will be asked to pick a network and input its password.

Important Note: The Wi-Fi configuration applies solely to the BerryBoot installer. When you install distributions like Rasbian, you will need to reconfigure Wi-Fi within each individual distribution.

Once Wi-Fi is configured, or if you are utilizing a wired connection, you will be prompted to choose a storage disk:

how-to-multi-boot-your-raspberry-pi-with-berryboot-2.jpg

The SD card is the default selection. If you intend to install the operating systems onto a connected flash drive or USB HDD, attach it at this stage. After identifying the desired disk (in this case, the SD card), select it and then press the Format button.

Following a short wait, you will be directed to the Add OS menu, where you can select the first operating system for installation. We will begin by installing Raspbian. Select it and press OK to initiate the installation process.

how-to-multi-boot-your-raspberry-pi-with-berryboot-3.jpg

Upon completion of the image download and installation, the BerryBoot menu editor will appear:

how-to-multi-boot-your-raspberry-pi-with-berryboot-4.jpg

This menu editor provides numerous functionalities. You can add further operating systems or remove existing ones. It also allows you to designate a default operating system.

Furthermore, you can modify the properties of individual images, adjusting the name and memory allocation. Cloning operating systems is possible—useful for distinct projects using Raspbian, for example. Backups of the entire SD card or individual operating system installations can be created to external storage.

In addition to these features, tapping the small double arrow on the right side grants access to advanced configuration options. These allow editing of BerryBoot’s configuration and system files, setting a password for BerryBoot, repairing damaged file systems, and switching between the GUI menu editor and the terminal.

While these options are comprehensive, our current focus is adding another operating system. Click Add OS. This will return you to the Add OS menu. We will now add OpenELEC to our BerryBoot system. Make your selection and press OK.

Once the second operating system image installation is finished, you can choose which one should be the default and click the “Make default” button. We will set Raspbian as our default operating system:

how-to-multi-boot-your-raspberry-pi-with-berryboot-5.jpg

With these steps completed, you are ready to exit the editor and test the multi-boot functionality. Press the Exit button on the menu bar. Shortly after, you will be returned to the main BerryBoot menu:

how-to-multi-boot-your-raspberry-pi-with-berryboot-6.jpg

If you previously set a default operating system, it will automatically begin a countdown to boot. Otherwise, the menu will remain idle, awaiting your selection. The default timeout for menu selection is 10 seconds.

To modify this timeout value, press the Edit menu button in the lower right corner, returning you to the BerryBoot menu editor. Then, navigate to the Advanced Configuration tab (accessed by clicking the double arrow on the menu bar) and edit the “bootmenutimeout” value within the uEnv.txt file.

Regardless of whether you adjust the timeout, the BerryBoot menu will consistently be the first screen displayed upon powering on or rebooting your Raspberry Pi from any installed operating system. You can select your operating system using a keyboard, mouse, or, if connected via HDMI and using a CEC-compatible HDTV, with the up and down arrows on your remote control.

Manually Adding Distributions to BerryBoot

Installation is typically straightforward when utilizing the pre-included BerryBoot images, like Raspbian and Puppy Linux. However, incorporating distributions beyond these defaults requires a slightly more involved process.

Preparing a Linux Distribution for BerryBoot

To successfully integrate a Linux distribution into BerryBoot, it must first be optimized for the SquashFS file system. The initial step involves obtaining an image of the desired distribution. This can be accomplished in one of three primary ways.

The most convenient method is to acquire pre-optimized images from the BerryBoot repository, which may not yet be included in the standard installer. These images are readily available and require no further SquashFS optimization.

Alternatively, if Raspberry Pi-optimized images are available for general download but haven't been specifically optimized for BerryBoot, you can simply download those images.

Lastly, for distributions like Raspbmc that necessitate an installer tool for direct download to the Pi, you'll need to create an image of the SD card after installation. A helpful tutorial on creating disk images using DD can be found here.

Utilizing the SquashFS Tool

In addition to the .IMG file, access to a Linux environment is essential. This can be a dedicated Linux desktop, a computer running a Linux Live CD, or even the Raspbian installation on your Raspberry Pi. A stable port of SquashFS hasn't been developed for other platforms, making Linux the preferred choice.

If your Linux distribution lacks SquashFS, install it using the following command in the terminal:

sudo apt-get install squashfs-tools

Converting the .IMG File

Connect an SD card or USB device containing the .IMG file to your Linux machine. We will refer to the image file as NewBerryBoot.img in the following commands. Open a terminal and execute the following commands on the .IMG file:

sudo kpartx -av NewBerryBoot.img

The kpartx command establishes device maps from partition tables. The --av switch adds the mappings and provides verbose output for monitoring the process. The output will resemble this:

add map loop0p1 (252:5): 0 117187 linear /dev/loop0 1

add map loop0p2 (252:6): 0 3493888 linear /dev/loop0 118784

The larger partition, loop0p2, is the one we need. Note the loop designation in your image (e.g., loop3p2) for subsequent commands.

Then, run these commands:

sudo mount /dev/mapper/loop0p2 /mnt

sudo sed -i 's/^\/dev\/mmcblk/#\0/g' /mnt/etc/fstab

sudo mksquashfs /mnt converted_image_for_berryboot.img -comp lzo -e lib/modules

sudo umount /mnt

sudo kpartx -d NewBerryBoot.img

These commands mount the partition, modify the file systems table within the original partition, optimize the image using SquashFS (excluding the lib/modules directory, which is shared across distributions), unmount the partition, and finally delete the partition mappings.

Adding the Distribution to BerryBoot

With the command-line operations completed, you can return to the BerryBoot GUI. Whether you used a pre-optimized .IMG or created your own, it’s time to add it to BerryBoot.

Insert the external media containing the .IMG file into your Raspberry Pi or a connected USB hub. Boot your Raspberry Pi using the original BerryBoot SD card. At the boot selection menu, press the Edit menu button to access the BerryBoot menu editor.

To add your .IMG file, click and hold the Add OS button:

how-to-multi-boot-your-raspberry-pi-with-berryboot-8.jpg

Select Copy OS from USB stick, which will then display a file selection dialog box:

how-to-multi-boot-your-raspberry-pi-with-berryboot-9.jpg

You might observe unusual .IMG name extensions (.img128, .img192) in the Files of Type box. Appending .IMG with 128/192/224/240 indicates the desired memory allocation for the distribution. If you omit this, you can adjust it later in the Edit section of the BerryBoot menu editor.

After selecting your .IMG file and clicking Open, allow time for the .IMG to be unpacked and installed. The BerryBoot menu editor will then display the new addition:

how-to-multi-boot-your-raspberry-pi-with-berryboot-10.jpg

The installation is now complete. To summarize, you can obtain or create an .IMG file for BerryBoot through these methods (from most to least stable): downloading from the official BerryBoot repository, modifying an existing .IMG with SquashFS, or creating an .IMG from an SD card installation and then modifying it with SquashFS. Greater deviation from established methods increases the risk of incompatibility or unforeseen issues. For instance, creating a .IMG of a Raspbmc installation and converting it to SquashFS may break the upgrade system.

Do you have a Raspberry Pi project you’d like us to explore? Share your ideas in the comments or email us at tips@howtogeek.com, and we’ll do our best to bring them to life.

#Raspberry Pi#BerryBoot#multi-boot#operating systems#Raspberry Pi setup#Linux