Booting up a Raspberry Pi for the first time
There is one device, mini device, that is smaller than your PC or laptop, but it has a specification just like a computer. That device is Raspberry Pi. In this post I will tell you how to boot a Raspberry Pi for the first time. For your information, Raspberry Pi has its own official OS named Raspbian, a Debian distribution for ARM architecture. Ok now let’s get to the tutorial.
Note: To see the specification of many series of Raspberry Pi, you can see here.
Requirement for this tutorial:
- Raspbian OS (you can get it here). For you who wants to install CLI-only Raspbian OS, you can download the Lite version. Otherwise if you want to install the Raspbian OS with the GUI version (with Pixel DE), you can download Raspbian OS with Pixel. In this tutorial I’m using the Lite version.
- Terminal.
- Raspberry Pi (any series, but in this tutorial I’m using Raspberry Pi 2 Model B).
- Ethernet cable (just to connect your Raspberry Pi into your computer for testing).
- USB cable for Raspberry Pi’s power supply connection.
- A Micro SD card for your Raspberry Pi’s storage (in this tutorial I’m using 32GB Sandisk Ultra Micro SD card).
- Nmap installed on your laptop or PC.
Okay that’s for the material. Now begin the instruction..
First, load your Raspbian image into your micro SD card. If you don’t know how to do that, you may want to read my post here. It’s okay to leave the space left to unallocated space, because we will configure that later.
Note: To make sure that the image file is written into your SD card, you can run sync command.
Second, go plug your micro SD card into your Raspberry Pi. Then connect it to your PC or laptop with the USB cable and Ethernet cable. Wait a minute for your Raspberry Pi to boot up.
Third, set up your cable network configuration to bridge the connection to the Raspberry Pi. In my laptop (Lubuntu 16.04 64bit), the configuration I made was change the Ethernet connection into ‘Shared to other computers’, and it looks like this:
Fourth, use the nmap to scan your local cable network. You can see what is your cable IP address by using ifconfig command, and see your IP address. In my case:
In my case, my local IP address was 10.42.0.1 (you can see it at the first interface). Then scan your entire subnet in your local network by using nmap, in my case it should looks like this:
user@linux:~$ nmap 10.42.0.1/24
After it finish, you may get the IP address of your Raspberry Pi. In my case, it looks like this:
As you can see, the IP address of my Raspberry Pi was 10.42.0.248 and only one port opened, and that’s the SSH port.
Fifth, you can SSH to the Raspberry Pi. You can execute this command:
user@linux:~$ ssh pi@10.42.0.248
After executing this command, you may be asked for password. The default password for Raspbian is raspberry. For your information, username “pi” is the default user for Raspbian. After going to SSH, you may get the shell of Raspberry Pi, like this:
After going to the Raspberry’s shell, you can execute this command to configure the storage:
pi@raspberrypi:~$ sudo raspi-config
And it should look like this:
You may want to select the first option to expand the entire SD card into your Raspberry Pi’s storage. After that, you may be asked to reboot the Raspberry. And after you reboot the Raspberry, you may be login again with SSH for the second time to access you Raspberry Pi.
Finally, your Raspberry Pi is ready to use. Thanks for reading this post.
Note: You may want to update and upgrade your Raspberry first before using it for your daily work by executing this command:
pi@raspberrypi:~$ sudo apt-get update
pi@raspberrypi:~$ sudo apt-get upgrade
Note: You also may want to install rpi-update after update-and-upgrade your Raspberry Pi for easier update for your firmware, by executing this:
pi@raspberrypi:~$ sudo apt-get install rpi-update
And for starting your update, you can execute this command:
pi@raspberrypi:~$ sudo rpi-update