Headless Raspbian Installation

Here are the steps I took to get Rasp­bian work­ing on my Rasp­berry Pi in a head­less fash­ion. The Ras­bian SD card image has just been released and can be down­loaded here.

Fol­low­ing the instruc­tions here:

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

I had to make one change to the instruc­tions as there was an error: repla­cing “bs=1M” with “bs=1m” due to using a dif­fer­ing ver­sion 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 poten­tially use ping 192.168.0.255 and see if it responds).

And we have a result!

$ ssh pi@192.168.0.10
pi@192.168.0.10’s pass­word:
Linux rasp­berrypi 3.1.9+ #168 PREE­MPT Sat Jul 14 18:56:31 BST 2012 armv6l

The pro­grams included with the Debian GNU/Linux sys­tem are free soft­ware;
the exact dis­tri­bu­tion terms for each pro­gram are described in the
indi­vidual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSO­LUTELY NO WAR­RANTY, to the extent
per­mit­ted by applic­able law.

Type ‘startx’ to launch a graph­ical ses­sion

NOTICE: the soft­ware on this Rasp­berry Pi has not been fully con­figured. Please run ‘sudo raspi-config’

pi@raspberrypi ~ $

Run raspi-config to change/update the timezone and memory split (less needed for the GUI if run­ning head­less), and to also update any pack­ages. 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 net­work con­nec­tion is dropped. Fol­low the instruc­tions here. I only altered the interfaces file to

#iface eth0 inet dhcp
 address 192.168.0.14
 gate­way 192.168.0.1
 net­mask 255.255.255.0

Another reboot to make sure that change takes effect (you could just restart the net­work­ing but that failed for me last time mean­ing I had to plug it in to a mon­itor to work out what had gone wrong…):

sudo reboot

Next, copy over your pub­lic 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 pack­ages that make life easier using sudo apt-get: screen, emacs, gfortran etc.