0. Prerequisites
This guide assumes you DO have:
- A model "B" Raspberry Pi
A Mac running OSX
A "big enough" SD card (I used a 16 GB - plenty big)
Some means to read/write an SD card on your Mac (built-in or USB adaptor)
A router with at least one spare ethernet socket
- A dedicated keyboard
A dedicated display
Access to administrative privileges on your router
- Open browser and visit http://downloads.raspberrypi.org/raspbian_latest. It will offer to download a file with a name such as '2014-01-07-wheezy-raspbian.zip'.
Download the file.
Locate the file in the finder and click on it to un-zip it. It will create a file with a name like '2014-01-07-wheezy-raspbian.img'.
Insert the SD card into your Mac using the built-in slot or a USB adapter.
Open a terminal window on the Mac.
In the terminal window, type 'df -h'. You should see something as follows:By process of elimination, it should be clear that the SD card is mounted as "/dev/disk2s1". The important part to remember is the "2" -- that is the disk number for the SD card. Type the following, substituting the disk number for X and the name of your image file where you see "2014-01-07-wheezy-raspbian.img":Code: Select all
$ df -h mbp:~ r$ df -h Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk0s2 465Gi 199Gi 265Gi 43% 52299389 69587353 43% / devfs 192Ki 192Ki 0Bi 100% 664 0 100% /dev map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home /dev/disk1s2 303Mi 280Mi 23Mi 93% 71633 5944 92% /Volumes/NI-DAQmx_Base_3.3.0 /dev/disk2s1 56Mi 19Mi 37Mi 34% 512 0 100% /Volumes/NONAME
It is now safe to unplug the SD card.Code: Select all
$ sudo diskutil unmount /dev/diskXs1 # Substitute disk number for X $ sudo dd bs=1m if=./2014-01-07-wheezy-raspbian.img of=/dev/rdiskX # Substitute disk number for X $ sudo diskutil eject /dev/rdiskX # Substitute disk number for X
2. Boot the Raspberry Pi and find its IP address- Connect the RPi to a spare Ethernet port on your router using an Ethernet cable.
Insert the SD card into the Raspberry Pi.
Power up the Raspberry Pi. Wait about 90 seconds.
Open a terminal window on your Mac and type "arp -a". You should see something like this:
Code: Select all
mbp:~ r$ arp -a ? (169.244.1.0) at (incomplete) on en1 [ethernet] wireless_broadband_router.home (192.168.1.1) at 0:26:62:7f:f3:e6 on en1 ifscope [ethernet] laptop.home (192.168.1.2) at d0:df:9a:1b:39:9c on en1 ifscope [ethernet] raspberrypi.home (192.168.1.8) at 80:1f:2:da:af:d on en1 ifscope [ethernet] revolvhub-000122.home (192.168.1.13) at b0:79:3c:0:1:22 on en1 ifscope [ethernet]
- From this, you can see that your Raspberry Pi has been assigned an IP address of 192.168.1.8. (Yours will likely be different.)
- In a terminal window in your Mac, type "ssh [email protected]", where "xxx.xxx.xxx.xxx" is the IP address you discovered in the previous step.
It will then prompt for your password. Type in the default password raspberry and type return. (Note that this will not echo on the screen.)
It will look something like this:
4. Expand the filesystemCode: Select all
$ ssh [email protected] [email protected]'s password: Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 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. Last login: Tue Apr 8 18:42:58 2014 from mbp.home
- Since this is the first time you are logging in, the RPi will run something called "raspi-config" so you can set configuration parameters.
- The only parameter we need to set now is "Expand Filesystem": select it, and use the arrow keys to highlight <Select>, then hit return.
You will see a message that the filesystem will be resized at the next boot and you'll be returned to the configuration screen.
Use the arrow keys to highlight <Finish> and hit return.
The next screen will ask "Would you like to reboot now?". Hit return to indicate <Yes>.
Your terminal will report "Connection to xxx.xxx.xxx.xxx closed" because the Raspberry Pi is rebooting.
Now you want to make sure your Raspberry Pi has the latest updates.- Give the RPi enough time to reboot, then log back in using SSH as before with 'ssh [email protected]'
When you get the prompt, type "apt-get update"
When that finishes, type "apt-get upgrade"
Congratulations! You now have a fresh-to-go Raspberry Pi.Code: Select all
pi@raspberrypi ~ $ sudo apt-get update Hit http://repository.wolfram.com stable Release.gpg Hit http://repository.wolfram.com stable Release ... Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en Reading package lists... Done pi@raspberrypoor ~ $ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done ...
6. Accessing the window server
Since you're using a Mac, there's a delightfully easy way to get to the window server. As neonecho correctly points out, you'll need to load ``tightvnc`` package onto your Raspberry Pi first. So ssh into your Rasberry Pi to load it:
(Code taken from: https://www.raspberrypi.org/documentati ... ccess/vnc/)Code: Select all
myMac ~ $ ssh [email protected] # instead of 198.168.1.8, use the IP address of your pi [email protected]'s password: Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l pi@raspberrypi ~ $ sudo apt-get tightvncserver # download the VNC server pi@raspberrypi ~ $ tightvncserver # start the VNC server pi@raspberrypi ~ $ vncserver :0 -geometry 1920x1080 -depth 24 # start a VNC session
Now, back on your Mac:- In the Finder, select Go => Connect To Server...
Type vnc://xxx.xxx.xxx.xxx (where xxx.xxx.xxx.xxx is the IP address that you discovered in step 2.
Click [Connect]. This will launch the Screen Sharing application, and with a little luck, you should see this image.
- Connect the RPi to a spare Ethernet port on your router using an Ethernet cable.