6 Ways to Pre-Configure Your Raspberry Pi Installation Before Booting
Installing an operating system on a Raspberry Pi is straightforward enough, but one element can be frustrating: configuration.
Network settings, username and password, SSH access, etc., must all be configured once the OS is up and running. Once or twice isn’t so bad, but if you have multiple Pis, or regularly reinstall the operating system, things can get repetitive.
Wouldn’t it be easier is you could pre-configure the Raspberry Pi OS and get started as soon as it boots? Here are X ways you can do that.
Why Is Pre-configuring Raspberry Pi Important?
When you set up a device for the first time, you usually get the opportunity to add wireless network details. It’s also the time to add a username and password, and any other useful configurations.
This happens with desktop and mobile devices. It also happens with the Raspberry Pi OS. So, why bother with pre-configuration?
Well, it saves a lot of time. If you need to run your Raspberry Pi headless, for example, you’re unlikely to want to bother connecting a display. Pre-configuring wireless access, SSH, and user credentials means you don’t need an extra keyboard and mouse for the Pi.
The following tools and methods all let you pre-configure a Raspberry Pi installation, and all need the microSD installation media.
1. Raspberry Pi Imager
The best way to install a Raspberry Pi operating system, Pi Imager features a hidden screen.
The Advanced Options page features a number of useful options:
- Set hostname
- Enable SSH
- Set username and password
- Configure wireless LAN
- Set locale settings
- Play sound when finished
- Eject media when finished
- Enable telemetry
You can also specify whether the settings you choose are for the current installation or all future installations.
To access Advanced Options, press Shift+Ctrl+X. Note that setting a username and password cannot be skipped; at the very least, a new password is required for the pi user account.
With the configuration specified, hit Save, then proceed with writing the OS to the SD card.
Download: Raspberry Pi Imager (Windows, macOS, and Linux.)
Another option for pre-configuring your Raspberry Pi is to take the holistic approach. With sdm, you don’t just get to pre-configure a few settings, you determine the entire operating system experience.
This means specifying everything from Wi-Fi network details to pre-installing software.
Our guide to using sdm to create a pre-configured, reusable Raspberry Pi disk image explains this in full detail.
A similar tool to Raspberry Pi Imager, BerryBoot is more suited to setting up a dual booted Raspberry Pi, with a vast selection of operating systems to choose from. However, among its many tools are pre-configuration options that will save time later.
Here, you can adjust some display options, specify a Wi-Fi network, and add Locale settings.
Once you’ve done this, you can choose the operating systems that you want to install. The configuration options you have specified will apply to all chosen OSs.
Pre-configuration options are covered in our in-depth guide to dual-booting a Raspberry Pi with BerryBoot. As well as Wi-Fi, you can edit the config.txt and cmdline.txt files.
You cannot pre-enable SSH with BerryBoot.
BerryBoot is essentially an installation script that must be copied to the root of a blank microSD card. As such, it requires a network connection for downloading the selected operating systems to your Raspberry Pi.
This is another option that works along similar lines to Raspberry Pi Imager and BerryBoot, NOOBS is actually the precursor to Raspberry Pi Imager, and like BerryBoot supports dual booting.
Configuration options include setting a Wi-Fi network and editing the config.txt and cmdline.txt files from the /boot/ partition.
With a configuration specified, it can be exported or set as a default. This is useful for future operating systems installed via NOOBS.
Like BerryBoot, NOOBS must be unzipped saved to the root folder of your Pi’s microSD card before use.
5. Manually Enable SSH and Edit wpa_supplicant.conf
If you don’t mind getting your hands dirty, you can pre-configure your Raspberry Pi operating system using text files.
Almost all Raspberry Pi operating systems rely on specific files in a /boot/ partition. These enable various configurations to be made while the Pi’s SD card is still in your PC.
For example, you can enable SSH. This is done by creating a blank text file with no file extension, simply labeled ssh, in the /boot/ partition.
Other settings can be tweaked in the config.txt file. Display overscan and orientation, HDMI mode, and even overclocking the Pi’s CPU can be controlled in this configuration file. Remember to make a copy before saving, in case anything goes wrong with your changes.
If you need to set up wireless networking on the Pi before booting, you’ll need to edit the wpa_supplicant.conf file. This is found in the /etc/ directory, however, which is unavailable on Windows.
Raspberry Pi SD cards feature a /boot/ partition which can be accessed on Windows, and a /rootfs/ partition which cannot.
Consequently, this cannot be easily edited without installing Windows Subsystem for Linux to browse the Linux partition.
On Linux (or macOS), use:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Here, you need to edit the file as follows:
Note that the country, ssid, and psk values must be changed as appropriate.
With the change made, save, exit, and confirm (Ctrl+X, then Y) and safely eject the microSD card. Your manual configuration will be used as the Pi boots.
6. Using macOS? Consider ApplePi-Baker
The ultimate Raspberry Pi utility for macOS users, ApplePi-Baker features everything from backup and restore to shrinking Linux partitions.
But while you can’t configure display settings or Wi-Fi access, ApplePi-Baker does let you enable SSH access. This is done within the app, rather than booting the Pi and accessing the raspi-config tool. As such, it is worth including in this list.
Raspberry Pi Set Up Is Easy With These Pre-configuration Hacks
It doesn’t matter if you’re single booting or dual booting, need a Wi-Fi connection established, or just want SSH enabling. These tools will take the pain out of configuring the Raspberry Pi after you booted it for the first time.
It might not seem like much, but pre-configuring your Raspberry Pi is a huge time saver. These tricks can be used with almost any Raspberry Pi project you tackle.