Setting up a raspberry pi without monitor.
Raspberry pi is a low cost, credit card sized micro-controller cum computer, though slightly slower than the modern desktop and laptops, the raspberry pi works pretty good given it’s size.
This micro-controller cum PC was released with the intention of using it for educational purposes, to introduce children to programming. The flexibility and low pricing made it an instant hit amongst tinkerers, makers, and electronics enthusiasts for projects that require more than a basic micro-controller (such as Arduino).
The Raspberry pi can be used like any other standard PC by connecting it to the computer peripherals like Keyboard, Mouse and Display(Monitor/TV via HDMI).
What if you don’t have a spare display or need to use RPi in embedded projects, for such scenarios the raspbian for RPi rolls out with pre-installed SSH and VNC server. Those who are unfamiliar with these terms SSH stands for Secure SHell and VNC for Virtual Network Computing. These services need to be manually turned on and requires a monitor for the initial setup.
Before heading any further, you’ll need to:-
i) Set up raspbian on raspberry pi. Follow this article for setting up raspberry pi.
ii) Connect the raspberry pi to your home network.
Steps to set up a headless raspberry pi
1) Turning on the SSH and VNC servers
- Login to your RPi using your username and password. The default username and password are pi and raspberry respectively.
- Start the terminal by hitting Crtl+T
- Type in
sudo raspi-config. This will open up the RPi configuration dialog.
- Navigate to the SSH and VNC section, hit enter select enable or disable to enable/disable the SSH and VNC server.
NOTE: SSH and VNC are different tabs and need to be enabled separately.
2) Using SSH Server
- Login to your raspberry pi
- Start the terminal by hitting Crtl+T
- In the terminal type the following line
ssh [email protected]
(By default it is
- If this doesn’t work then, you must find out the local IP assigned by your router
(Follow the guidelines provided by your router to get the list of connected devices)
- Once you successfully find out your IP address then, you will be prompted to enter your password. The default password is – raspberry.
To reset your password you will need to access your raspberry pi using a monitor and type in the following command in the terminal –
- Follow these steps and you will be connected to your raspberry pi using the terminal
- Additionally, you can set up X-forwarding to allow the use of graphical applications. You can do that by adding a
-Yflag in the command
ssh -Y [email protected]<IP>
3) Using a VNC Server
VNC, or “Virtual Network Computing”, is a connection system that allows you to use your keyboard and mouse to interact with a graphical desktop environment on a remote server.
VNC makes managing a remote server easier for users who are not yet comfortable with working with the command line.
To connect to your Raspberry pi using VNC you will need to:-
- Install a VNC Client a.k.a VNC Viewer of your choice. I used RealVNC – which supports multiple OS and even browsers.
(You need to follow the procedures for the Operating System of your choice)
- On your Raspberry pi (using a terminal window or via SSH) get the private IP address of your RPi by typing in
- Enter your Raspberry Pi’s private IP address into VNC Viewer:
Click on connect, if this doesn’t work. You have either:
i) Not enabled VNC server
ii) VNC server is listening to another port, in such cases you will need to find out the port at which VNC server is listening
- Authenticate the VNC Server by entering in the Username and password of your Raspberry pi. Default:
- To start serving remote desktop through VNC type in the following command in your terminal or via SSH
vncserver. It will print out the IP and the port details of the server.
- Enter this information into the VNC Viewer and you are good to go…
A remote connection is very useful when you are using the Raspberry pi in an embedded project or when you don’t have a display to spare..
Learn how to setup a Raspberry pi for the first time – Setting up a Raspberry pi.