Headless Raspbian Installation

Here are the steps I took to get Raspbian working on my Raspberry Pi in a headless fashion. The Rasbian SD card image has just been released and can be downloaded here.

Following the instructions here:

$ unzip 2012-07-15-wheezy-raspbian.zip 
Archive:  2012-07-15-wheezy-raspbian.zip
  inflating: 2012-07-15-wheezy-raspbian.img  
$ df -h
$ diskutil unmount /dev/disk2s1
Volume RASPI on disk2s1 unmounted
$ sudo dd bs=1m if=2012-07-15-wheezy-raspbian.img of=/dev/rdisk2
1850+0 records in
1850+0 records out
1939865600 bytes transferred in 198.319278 secs (9781528 bytes/sec)
$ diskutil eject /dev/rdisk2
Disk /dev/rdisk2 ejected

I had to make one change to the instructions as there was an error: replacing “bs=1M” with “bs=1m” due to using a differing version of dd.

Plug that memory card into the raspi and wait a minute, then find the IP (I did this via my router, but could potentially use ping 192.168.0.255 and see if it responds, or sudo nmap -sP 192.168.1.0/24 which is a better solution).

And we have a result!

$ ssh pi@192.168.0.10
pi@192.168.0.10's password: 
Linux raspberrypi 3.1.9+ #168 PREEMPT Sat Jul 14 18:56:31 BST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Type 'startx' to launch a graphical session

NOTICE: the software on this Raspberry Pi has not been fully configured. Please run 'sudo raspi-config'

pi@raspberrypi ~ $

Run raspi-config to change/update the timezone and memory split (less needed for the GUI if running headless), and to also update any packages. Then reboot to get those changes to take effect:

sudo reboot

The next thing is to change to the Raspi to a static IP so you can find it any time it restarts or your network connection is dropped. Follow the instructions here. I only altered the interfaces file to

#iface eth0 inet dhcp
 address 192.168.0.14 
 gateway 192.168.0.1
 netmask 255.255.255.0

Another reboot to make sure that change takes effect (you could just restart the networking but that failed for me last time meaning I had to plug it in to a monitor to work out what had gone wrong…):

sudo reboot

Next, copy over your public key and, as this is fresh install, make .ssh and authorized_keys.

pi@raspberrypi ~ $ mkdir .ssh
pi@raspberrypi ~ $ mv id_rsa.pub .ssh/authorized_keys

Finally, start adding in some packages that make life easier using sudo apt-get: screen, emacs, gfortran etc.

essential