This How-to pertains to Raspberry Pi OS BOOKWORMEnable SSH & WiFi BEFORE First bootImage written to microSD Card using Balena Etcher or Win32DiskImagerNo 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.tomlIn 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.tomlPlease replace values of parameters by your own values.
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 .