Time to complete: 10-15 mins; Level of Difficulty: Beginner
After completting the Getting Started with Raspberry Pi activity, we’re ready to get our hands dirty with some projects. In this tutorial we’ll learn how to use the Raspberry Pi with the minimum number of components possible!
| Item Name | Qty. |
|---|---|
| Raspberry Pi 2 Model B | 1 |
| Item Name | Qty. |
|---|---|
| 5V USB Charger/Power Supply (2.1A) | 1 |
| Item Name | Qty. |
|---|---|
| Ethernet Cable | 1 |
In the context of computer systems, a headless setup is one where the system isn't connected to any peripherals, namely, a mouse, keyboard, or monitor.
In the case of the Raspberry Pi single-board computer, the system works just as well (if not better) in a headless setup than in one where it's connectd to a keyboard, mouse, and monitor. Not only does running a headless lowers the overall cost of the setup, but it also reduces power consumption as well as its space requirements. One difficulty we face, however, is accessing the Pi without the use of any peripherals. Fortunately, this is something that's been heavily developed for a number of decades, particularly in Linux-based systems. For example, this is how developers tend to access servers running on cloud-based platforms such as Amazon's EC2.
As you're about to see, the headless setup is of the utmost convenience, however, keep in mind that it will always be easier to perform any configuration, or debug any error on the Raspberry Pi by connecting it to a monitor, keyboard, and mouse.
This tutorial is based on the Raspbian distribution.
First, you need to turn on your Internet Sharing. On your computer, go to System Preferences and click Sharing. Then go ahead and turn on Internet Sharing.
Our next step is to determine the Raspberry Pi’s IP address. We will be using the Terminal to type the commands we need. So go ahead and open Terminal. On your Terminal, type:
cat /var/db/dhcpd_leases
This will show you one or more IP addresses that your Raspberry Pi’s has acquired whenever you connect them to any devices. The one that we are using is the first one. In my case, my IP address is 192.168.2.2
Next, we are using our unique IP address to an ssh command. In my case, it’s ssh [email protected]
It will ask you for the Raspberry Pi’s password, the temporary password is raspberry unless you changed it on the configuration page after your first time log in to Raspberry Pi’s GUI.
Next, we need to install a VNC server in your Raspberry Pi. But before we do that, you might have been wondering what VNC means.
VNC or Virtual Network Communication means desktop sharing between two computers. Since Raspberry Pi is a computer on it’s own, it will just get the input from your computer’s keyboard and relay the information to the Raspberry Pi and shows the output back to your computer’s screen through Raspberry Pi’s GUI. To make this happen, we will need both Server and Client. It works like Transmitter and Receiver in terms of radio communication.
There are plenty of VNC server applications for Raspberry Pi ecosystem. One good example is called TightVNC. Here’s how to install:
On your terminal, type:
sudo apt-get install tightvncserver
After the package is installed, press Y to continue.
Now that a VNC server is installed in your Raspberry Pi, we need to open the program. To open, just type:
tightvncserver
When you first open TightVNC, it’s gonna ask you to create your own password. We will use this password later on to use on a VNC Client.
Now that every thing is ready, you still need to install a VNC Client on your computer. One good VNC Client that you can use is Chicken Of The VNC. You can download this program from this link: http://sourceforge.net/projects/cotvnc/
After installing, open Chicken Of The VNC. Then on the left hand side, choose New Server. Next, put the IP address that we have acquired earlier on the Host box. For Display box, put 1. After doing that, use the password that you have created earlier from TightVNC server on the password box and press connect.
And now, you have succesfully opened Raspberry Pi’s GUI on your computer!
Now every time you want to access Raspberry Pi’s GUI, all you need to do is:
Comments, questions, or concerns? Drop us a line!.