Friday 22 May 2020

Headless install of raspberry pi

This is mostly all here, but here's a simplified version - this was current as of 2019, I haven't got a pi handy to test with right now.

The goal here is to set up an SD card with the installer, and then power on the Raspberry Pi with that SD card and have it appear on the network after it's finished installing without any interaction. This is handy when you don't have a spare screen or keyboard to be able to perform the install interactively.

How to:
1. Format an SD card.
2. Get the NOOBs distribution zip, extract it to previously formatted SD card.
3. Create a file called 'ssh' in the root directory of the SD card to enable the SSH server so you can login after it boots.
4. Create a file called wpa_supplicant.conf in the root directory of the SD card to join a wifi network automagically, with contents like:

country=gb
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
    scan_ssid=1
    ssid="Network name goes here"
    psk="password goes here"
}

5. Open the recovery.cmdline from the SD card and append 'silentinstall' to the line

6. Make sure you set all your line endings to unix style in the editor you use.

7. Eject the SD card, insert it in the pi and boot it. It should appear on your network after it finishes installing (not hours, 10s of minutes).

No comments:

Post a Comment