Raspberry Pi Headless Setup

A tiny package arrived today. Max Spiker on Twitter sent me a Raspberry Pi (Version B). I plan to use it up as a WordPress server and do posts about serving WordPress with (very) limited resources.

I didn’t have a USB keyboard or HDMI cable handy, so here’s how I set it up “headlessly”, using OS X.

Required

  • SD Card (at least 2GB)
  • USB power supply (I used my Kindle power adapter)
  • Micro USB cable
  • Ethernet cord

Steps I Took

Downloaded a “Raspbian” disk image. Unzipped it. Renamed it rpi.img.

I plugged the SD card into my Mac.

$ df -h
{REDACTED}
/dev/disk5s1    15Gi  3.0Mi   15Gi     1%         0         0  100%   /Volumes/NO NAME

disk5s1 was the one I wanted.

Make sure you get this right. If you get this wrong, you will end up wiping another one of your drives. This will be a sad Christmas.

Next, I unmounted it.

$ sudo diskutil unmount /dev/disk5s1

Next, I copied that disk image onto my SD card like so:

$ sudo dd bs=1m if=/Users/mark/Downloads/rpi.img of=/dev/rdisk5

Note how disk5s1 became rdisk5 — drop the s{number} suffix and prepend r. This is the dangerous step. Don’t get it wrong.

It took a while to write the image out (SD cards are slow). Once it was down, I unmounted the drive:

$ sudo diskutil eject /dev/rdisk5

I plugged the SD card into the Raspberry Pi, connected the Raspberry Pi to my router using an ethernet cable, and then plugged in the micro USB power cord. Waited a minute or two for it to boot.

Next, I peeked at my router to see what IP address the Raspberry Pi had grabbed: 192.168.1.42.

$ ssh pi@192.168.1.42
pi@192.168.1.42's password: raspberry

That’s it! I was in. Simple enough. There are lots of tutorials that’ll walk you through next steps. I’ll post again once I have WordPress running.

2 thoughts on “Raspberry Pi Headless Setup

  1. Kurt Greiner

    Lovin my Pi! I cheated a bit on the setup, but now running it headless. Have the PiAMP stack running, but haven’t installed WP on it yet. Been busy playing to see if I can get an SDR setup functioning. Learning, again, how to deal with a resource constrained system brings me back to my first computer in 1980. So much fun!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime=""> <em> <i> <li> <ol> <pre> <strike> <strong> <ul>

Anti-Spam Quiz: