anything
AirNav RadarBox
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 


Author Topic: Enabling WiFi & SSH on RaspberryPi OS Bookworm BEFORE First Boot  (Read 866 times)

0 Members and 1 Guest are viewing this topic.

abcd567

  • Hero Member
  • *****
  • Posts: 844
  • CYYZ - Toronto
Enabling WiFi & SSH on RaspberryPi OS Bookworm BEFORE First Boot
« on: February 28, 2024, 11:36:21 PM »
This How-to pertains to Raspberry Pi OS BOOKWORM

Enable SSH & WiFi BEFORE First boot
Image written to microSD Card using Balena Etcher or Win32DiskImager
No Monitor+Keyboard required.

Headless (Lite) RPi OS Bookworm
Unlike previous releases Bullseys, Buster, Stretch etc, the current release Bookworm does not let configure WiFi or enable SSH by adding files wpa_supplicant.conf & ssh in /boot partition while microSD card is still plugged into Desktop / Laptop.

However enabling SSH & WiFi configuration can still be done in Bookworm by addin a file custom.toml. Below is the guide to do it.

This is a temporary/experimental sytstem, working till the day of this post, but may be replaced by cloud_init in future.
 
After writing RaspberryPi OS image Bookworm (LITE) to microSD card, using Balena Etcher or Win32DiskImager, do not eject the card reader / microSD card.

While the microSD card is still in card reader of your Laptop / Desktop, open the card reader drive. This will open /boot partition of microSD card. In this partition, create a blank file named custom.toml.

IMPORTANT: Make sure there is no hidden or visible file extension .txt at the end of file name custom.toml

In the newly created blank file custom.toml, copy paste following code.
Please replace values of parameters by your custom values.
Save File custom.toml

Slip out microSD card from card reader, slip into RPi and power up. The WiFi and SSH both will ber available.

Contents of file custom.toml
Please replace values of parameters by your own values.

Quote


config_version = 1

[system]
hostname = "raspberrypi"

[user]
name = "pi"
password = "my-rpi-password"
password_encrypted = false

[ssh]
enabled = true
password_authentication = true

[wlan]
ssid = "my-wifi-ssid"
password = "my-wifi-password"
password_encrypted = false
hidden = false
country = "CA"

[locale]
keymap = "us"
timezone = "America/Toronto"




REFERENCES:

(1) custom.toml example for Raspberry Pi OS · GitHub

(2) wifi - Headless Wi-Fi setup without the RPi Imager: bootfs/wpa_supplicant.conf not supported since Bookworm - Raspberry Pi Stack Exchange
 

 .
« Last Edit: March 03, 2024, 05:05:18 PM by abcd567 »