If you have ever wanted to run more than one operating system on your Raspberry Pi, then this is the project for you!

Today we’ll learn an easy method of running two, or more, operating systems on your Raspberry Pi.  And it works with both microSD cards and USB sticks.

Dual Boot

Actually, “dual boot” is a bit of a misnomer, as you can run as many operating systems as you want to on your Pi, providing you have a microSD card or USB stick large enough to hold them all.

Using multiple operating systems is a pretty familiar concept to Linux users, who often run Linux along with Windows or macOS on their machines. Generally, it involves partitioning the system’s SSD or hard disk into independent partitions for each OS, particularly useful if the two operating systems use a different disk format.  

When the computer is booted up, a menu system, which may be a GUI or may just be a simple text menu, offers the user a choice of operating system. Usually, one system is designated as the default, so that after a timeout it will load.  This is in case the system is restarted in an unattended mode.

This menu system is part of your system “bootloader”, the software that runs when the computer is started or reset.

We can accomplish the same thing with Raspberry Pi.

PINN System Resize

The key to making all of this work comes courtesy of a website in New Zealand, the PINN System Resize site

The site has you enter all the parameters for your dual (or multiple) boot configuration, and it then creates a bootloader file that we can use on the Raspberry Pi.  It also creates a recovery file for you.

After downloading the two files and merging them (I’ll explain that procedure shortly) you then move them onto a blank, FAT32, microSD card, or USB stick, which you will use in your Raspberry Pi.

When you boot the Pi, you’ll get a menu with your choice of operating systems. Note that at this point you haven’t actually installed the operating systems, you just have made space for them. The menu will guide you through the installation.

Project Requirements

PINN will work with pretty well any version of the Raspberry Pi, and the only other thing you’ll need to have is a blank microSD card, formatted with the FAT32 file system.  I’ll explain how to get your card formatted correctly in a few moments.

The microSD card needs to be large enough to accommodate all the operating systems that you want to install, I would suggest a 32GB or greater card to allow plenty of space. If you want to install more than two operating systems, you may want to move up to 64GB, or even 126GB.

You’ll also need a network connection for your Raspberry Pi in order to download your operating systems.

And you’ll need another computer, Windows, Mac, or Linux, to create the bootloader. That computer will need to have a microSD drive on it. You could even use another Raspberry Pi with a USB to microSD adapter.

FAT32 Format

Perhaps the most challenging thing about setting up the PINN dual boot system is the requirement that the microSD card or USB stick is formatted in FAT32 format. Cards or drives formatted in exFAT will not work.

If you choose to use a microSD card that has a capacity of 32GB or less, then you can use the excellent SD format utility created by the SD Association. It is available for Windows or macOS.  When formatting the card, select FAT32 from the menu.

But if you are using a USB stick or a microSD card that is greater than 32GB you’ll find that most utilities will insist upon using exFAT, and won’t provide an option for formatting in FAT32.

If you are running Windows, there is a solution, in the form of a utility provided by Verbatim.  This utility is a FAT32 formatter, and it will successfully format your cards or disks larger than 32GB as FAT32.

Unfortunately, I haven’t (as yet) been able to find an equivalent utility for Linux or macOS, if you know of one please add it to the comments, and I’ll update the article.

Setup Dual Boot

Here are the instructions for setting up a dual boot system. If you want more than one operating system, the instructions are nearly the same.

Configure the Bootloader

The very first step is to go to the PINN System Resize website.

The first page of the site has a set of buttons to select your card size. If you don’t see a button for your card size, you can type it into the box provided. It is better to underestimate the size than to overestimate it, as most microSD cards are actually a few megabytes short of their advertised size after they are formatted.

After selecting your card size, you’ll arrive at another page, where you can select your Raspberry Pi model.  There is a button for pretty well every Pi ever made! Make sure you select the correct model, as this is a very important parameter.

The next page is where you will select all the operating systems you want t install on the card.  There is a wealth of selections here, ranging from lite versions of operating systems to full versions, dedicated game builds, and even legacy systems.  If you can run it on a Raspberry Pi, then it is likely included here!

The most common choices are found under the General tab.  You can select them by clicking on the icon on the far left of the row that describes the OS.  In my case, I selected the 64-bit version of the Raspberry Pi OS (bullseye) and Ubuntu 20.10. You can choose different ones if you like.

Once you have made your selections, click on the Next button at the top of the page (you may need to scroll up to see it).  Note that the amount of space you’ll need on the microSD card is also displayed above the button.

On the next page, you will see a slider that lets you partition the microSD card for the operating systems you have selected. By default, each OS is provided with the same amount of space, but you can change this to suit your requirements.  In my case, I left it as it is. Once again, you’ll need to click the Next button to continue.

Finally, we are at the page where we can download our bootloader files. There are two files you’ll need to download:

  • pinn-lite.zip – This is the main bootloader folder, in a ZIP format.
  • recovery.cmdline – Thai file replaces a file that is in the bootloader folder.

After downloading the files, you’ll need to do the following:

  • Unzip the pinn-lite.zip file into a known location.  I suggest creating a folder named “PINN” to extract the files into.
  • After the files are extracted, copy the recovery.cmdline file into the folder with the extracted files. You’ll receive a message asking if you want to replace the existing file, confirm that you do.
  • Copy the contents of the directory you extracted the files into to the FAT32-formatted microSD card.

Now you can remove the card and insert it into your Raspberry Pi.

Running Dual Boot

When you power up the Raspberry Pi with the microSD or USB device you’ll get a few colorful screens, and will eventually land on the boot menu.

If this is the first time booting up, then your card still doesn’t have the operating systems installed, it just has the bootloader and menu.  There are a few things you might want to do before installing the OS files:

  • Use the selector at the bottom to select the correct language and keyboard. It defaults to a UK keyboard, so you may need to change this to a US keyboard.
  • There is a WiFi button at the top of the menu that lets you set up your WiFi. This is only necessary if you do not have an Ethernet connection.

If possible, you’ll want to skip the WiFi and use an Ethernet cable, as downloading the operating system over WiFi can take a lot longer. Of course, if you only have WiFi, such as with a Raspberry Pi Zero W, then you have no choice but to use it.

Installing the Operating Systems

Once you have configured your keyboard, and possibly WiFi, you are ready to actually install the operating systems you have chosen.

To the left of each OS listing there is a checkbox, by default, it is checked.  Unless you specifically don’t want to install that OS you should leave it checked.

Now click the Install button on the top menu to begin the installation.

Depending upon which operating systems you have selected, this can take some time, especially if you are using WiFi or have a slow connection to the Internet.

Once it is done, you’ll be restarted and taken back to the menu. You may now select one of the operating systems.  Click the Boot button to load your selection.

The operating systems are installed, but they are not yet set up. So when you first start an operating system you’ll need to go through the usual setup procedure to provide your location, language, and account settings.

Conclusion

Having the ability to run more than one operating system on a Raspberry Pi can be very useful. It’s a great way to evaluate new operating systems or to run software unique to one of them.

The PINN Website makes creating a dual boot, or multi-boot, Raspberry Pi very simple. The hardest part is getting a microSD card or USB drive formatted in FAT32, but once you have achieved that, then the utility is quite easy to use.

Happy dual booting!

 

Raspberry Pi Dual Boot
Summary
Raspberry Pi Dual Boot
Article Name
Raspberry Pi Dual Boot
Description
Learn to run multiple operating systems on your Raspberry Pi. You can have two or more systems on the same MicroSD card or USB stick, and you'll get a nice menu when you boot up to allow you to select which one to use.
Author
Publisher Name
DroneBot Workshop
Publisher Logo

If you have a question...

Comments about this article are encouraged and appreciated. However, due to the large volume of comments that I receive, it may not be possible for me to answer you directly here on the website.

You are much more likely to get answers to technical questions by making a post on the DroneBot Workshop Forum. Your post will be seen not only by myself, but by a large group of tech enthusiasts who can quickly answer your question. You may also add code samples, images and videos to your forum posts.

Having said that, please feel free to leave constructive comments here. Your input is always welcome. Please note that all comments may be held for moderation.

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
razy
5 months ago

Thanks for the tutorial.
The verbatim software tool did not recognize my 128GB sd card so I have used another tool recommended by sandisk support website
https://kb.sandisk.com/app/answers/detail/a_id/22476/~/formatting-sandisk-memory-card-products-in-fat32-format-using-third-party

I have a question. How to connect to VNC before installation? because I don’t have a monitor to connect to.

Last edited 5 months ago by razy
1
0
Would love your thoughts, please comment.x
()
x