Skip to content

Instantly share code, notes, and snippets.

@davps
Last active May 1, 2019 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davps/5707cdfdabd5c2f15e2f1dd08bdb305e to your computer and use it in GitHub Desktop.
Save davps/5707cdfdabd5c2f15e2f1dd08bdb305e to your computer and use it in GitHub Desktop.
Steps to configure my raspberry pi with Rapsbian Jessie using silentinstall (headless installation)

Install Raspbian Jessie on Raspberry Pi using silentinstall (headless installation), ready for SSH access

This http://raspberrypi.stackexchange.com/a/19928 is an amazing guide but it is not up to date. So I modified it here to document the steps I followed to install Raspbian Jessie on my Raspberry Pi. You can refer to that guide for more details.

Using only the laptop's screen and keyboard (both before and after installation), install and configuration for headless operation using SSH is possible using NOOBS (they call it "silent install"). It does not require a separate screen or keyboard/mouse. It does require an SD card reader on the laptop (built in or external USB), though.

The only thing required on the Raspberry Pi side is an Ethernet connection (to SSH into it from a host system). Alternatively, using special hardware (USB-to-serial adapter), it possible to use some GPIO pins on the Raspberry Pi.

Prerequisites:

  • A host computer capable of running an SSH client and of reading/writing the file system on the Raspberry Pi's SD card (ext4). The operating system could be Windows, Mac or Linux. This could be a computer that is normally running Windows, but which has a DVD drive so Ubuntu can be started in trial mode using a LiveCD.
  • An Ethernet connection to the Raspberry Pi and accessible by the host computer TCP/IP-wise (the host computer could itself use Ethernet or a wireless connection).
  • A text editor on the host system that can correctly handle Unix end-of-line characters. For example, UltraEdit on Windows that I have used for testing. Notepad++ and Vim on Windows should also be fine.
  • An SD card reader (to make crucial changes to the SD card during the process, both pre-install og post-install).

HowTo

Pre-install

For instance, to automatically install Raspbian (the recommended choice) when power is applied to the Raspberry Pi with the SD card in, do the following offline (on the host system, Windows, Mac or Linux):

1- Format a sufficiently large SD card, 4 GB or greater.

Using a mac: The SD Association's Formatting Tool is also available for Mac users although the default OSX Disk Utility is also capable of formatting the entire disk. Select the SD card volume and choose "Erase" with:

  • MS-DOS (FAT) format,
  • Master Boot Record Scheme.

Some times the erase fails, in that case, just repeat and it will work.

Using a PC: This can involve using SDFormatter https://www.sdcard.org/downloads/formatter_4/ with option "FORMAT SIZE ADJUSTMENT" set to "ON" to format the entire SD card as one big FAT32 formatted partition). See the linked page for details.

2- Download NOOBS. I used NOOBS 2.1.0, released 2016-11-29, a 1.17 GB download http://vx2-downloads.raspberrypi.org/NOOBS/images/NOOBS-2016-11-29/NOOBS_v2_1_0.zip Unzip the file.

3- Copy NOOBS on the SD card (all files to the root of the SD card).

4- Edit file recovery.cmdline (located in SD card root partition) to append silentinstall to the arguments list.

Before (may differ depending on NOOBS version):

runinstaller quiet ramdisk_size=32768 root=/dev/ram0 init=/init vt.cur_default=1 elevator=deadline

After (may differ depending on NOOBS version):

runinstaller quiet ramdisk_size=32768 root=/dev/ram0 init=/init vt.cur_default=1 elevator=deadline silentinstall

Delete the extra file(s) that your text editor may produce (such as a .bak file).

5- Put the SD card into the Raspberry Pi.

6- Power the Raspberry Pi on to start the installation. And wait! This can take a while, like half an hour or more. To be sure, leave it alone for a few hours. (3 hours was OK for the RPI2)

5- Shut down the Raspberry PI and insert the SD card on another computer to write a file on it, because SSH can be enabled by placing an empty file named ssh, without any extension, onto the boot partition of the SD card.

6- Put the SD card on the Raspberry PI again and turn it on. Connect it with an Ethernet cable such that the host system with the SSH client can see it and such that DHCP is available to the Raspberry Pi (for instance, most NAT-routers have a DHCP server built in). Perhaps disconnect the system from the Internet until the password has been changed.

Post-install

1- Find the Raspberry Pi's IP address (assigned by DHCP) somehow. For instance, guess it from the IP address range that a DHCP server in a NAT router uses and ping those addresses (mine is set up to use 192.168.0.100 - 192.168.0.255 and often it is assigned 192.168.0.100 or 192.168.0.101).

2- Ping from the host to test if there is a connection.

3- SSH to the Raspberry Pi

$ ssh pi@192.168.0.100

The default credentials are:

User: pi

Password: raspberry

4- Change to a new password typing those two commands

   $ su pi
   $ passwd

Sources

https://github.com/raspberrypi/noobs/blob/539662d46e2a2b2bb19d23eeceb41e841cad90a6/README.md

http://raspberrypi.stackexchange.com/a/19928

http://raspberrypi.stackexchange.com/a/58455

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment