In this article we will take the SD card containing Raspbian Wheezy that we created in my last post, and we are going to boot the Pi blind, aka set up Raspberry Pi without monitor.
If you plan to use the Pi as a server rather than a desktop environment, you do your work from the command line, or you just want to save money on accessories, we can completely remove any need for a monitor, keyboard, mouse, etc by taking advantage of DHCP.
I am going to make a couple of safe assumptions here before I go any further.
- 1. You have a router that you know how to access. (if you don’t it should be easy enough to find out how using the google machine)
- 2. That router is running DHCP.
- 3. You will connect the Pi to that router via Ethernet on initial boot.
- 4. You have an alternate computer connected to this router’s network.
I feel I can safely assume that even the biggest n00b will satisfy these requirements. If, in the case you are not connecting to a router, or it isn’t running DHCP or you aren’t connecting via Ethernet cable to that router, or you don’t have another computer, then fine…you need a monitor.
For the rest of us, lets continue.
Using either the 2012-07-15 or 2012-08-16 releases of Wheezy, you will have created an image that will boot with DHCP and SSH enabled. What this means is the minute you power up the Pi, it will ask your local network for an IP and assuming boot went smoothly, it will allow remote access using the default credentials (user = pi, pass = raspberry). You may have been advised that, without a monitor, you won’t know the IP your Pi is given, however as long as you can admin the router you are using, you will always know the IP.
So how do we find the IP?
Well the router you are using, whether high end or a run of the mill ISP provided box, will keep a record of all the IPs it has handed out and to whom – aka DHCP bindings. All we need to do is to ask it for that list before we plug in the Pi then ask again after the Pi comes alive. Now, there are many a router out there, but the general idea is the same on all of them. You will need to connect to your router and you will need to know the proper credentials to get in. Personally I use Cisco IOS and Juniper Junos based routers, so i SSH into mine. Apple users can use their Airport utility to find the same info, and most others will just need to point their browser to a specific address to log in (ie 192.168.1.1). Regardless we all will find the DHCP bindings once we log in.
Here is how to find the DHCP client list on some common routers:
n00brouter#show ip dhcp binding
IP address Client-ID/ Lease expiration Type
192.168.2.21 xxxx.ff61.xxxx.ae Aug 27 2012 11:21 PM Automatic
192.168.2.26 xxxx.cba1.xxxx.6f Aug 28 2012 12:40 AM Automatic
192.168.2.28 xxxx.11be.xxxxx.b3 Aug 27 2012 08:12 PM Automatic
user@host> show system services dhcp binding
address MAC address Binding Type Lease expires at 192.168.1.2 00:a0:12:00:12:ab static never 192.168.1.3 00:a0:12:00:13:02 dynamic 2004-05-03 13:01:42 PDT
Apple Extreme Base Station (2nd Gen)
**please advise if New basestations/Timecapsules has different DHCP client list location**
Airport Utility > Advanced > Logging & Statistics > Logs & Statistics > DHCP Clients
Please post your router model and how you found the DHCP bindings aka DHCP client list in the comments below and I will add it to the list!!
Unable to find the DHCP bindings? Post your router model below and I will try and help!!
As you can see, although the exact process may differ, all the routers provide the same information. As long as you have admin access to the router you are connected to, you will be able to glean the IP your Pi is given and subsequently SSH to it without the need for a monitor!
Now you can fire up your favorite terminal application and SSH to this IP with the default credentials.
For example from my Macbook Pro terminal:
MBP:~ n00bamin$ ssh email@example.com
firstname.lastname@example.org’s password: raspberry
On a windows machine I recommend using PuTTY. Just insert the IP as the hostname and login with user Pi and password Raspberry.
There you have it! No fussing with HDMI cables to your TV or buying extra accessories and now we have full access to get started with our Pi!