Using Raspberry Pi with Laptop as Screen using SSH
- Hey there, in this tutorial we will be learning about how to use laptop as Display for Raspberry Pi. Laptop’s keyboard and pointer will also work with it, hence will no longer need Dedicated display, mouse, and keyboard. We will be using SSH protocol and VNC server to Interface with raspberry pi.
- But don’t be excited, you will need a dedicated HDMI display, mouse and keyboard for initial process.
- Before starting the tutorial, we hope that Raspbian is installed in your Pi’s SD card and has been booted already.
( If you haven’t installed Raspbian on Pi, please refer our tutorial – https://robu.in/getting-started-with-raspberry-pi/ )
Buy our Raspberry Pi Starter Kit –
Buy our Raspberry Pi Advanced Started Kit –
Step 1 – Creating a blank SSH file in SD Card (Windows)
- For this, eject the SD card from the Pi and insert it into the laptop using SD Card holder. In SD card we have to load a blank SSH file.
- For this open command prompt on your laptop in which SD card is inserted and give the command “echo>I:\ssh” where I is the drive letter allotted to the SD card drive.
- And press Enter. A blank file named ssh will be created in SD card like shown-
- Now eject the SD card safely from the Device.
Step 2 – Enabling SSH in Raspberry Pi
Plug in your Pi, connect a HDMI Display, Mouse and Keyboard.
- Open the terminal of your Raspberry Pi and write command “sudo raspi-config” and press Enter.
- A Raspberry Pi configuration menu will open. Now use arrow keys to change between the options and press Enter on 5th option, i.e Interfacing option
- Now, move to the 2nd option, i.e SSH and press Enter
- A window will open to ask you to enable the SSH Server. Select YES using side arrow keys and press Enter
- A pop-up will appear showing that SSH server is Enabled.
Step 3 – Enabling VNC Server in Raspberry Pi
- Repeat the same steps given in Step 2. But now enter into the 3rd Option, i.e VNC in Interfacing Options menu.
- A window will open to ask you to enable the VNC Server. Select YES using side arrow keys and press Enter
A pop-up will appear showing that VNC server is Enabled.
Now both SSH and VNC server are enabled. Now reboot the raspberry pi.
Step 4 – Downloading the required Softwares in Laptop
You will need to Download 3 softwares in your Laptop. All softwares with their download links are given below ( Please make sure that you are downloading the suitable version of the software depending on your system ) –
- Angry IP Scanner. Click here to download or visit this link : https://angryip.org/download/#windows
- PuTTY. Click here to download or visit this link : https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
- VNC viewer. Click here to download or visit this link : https://www.realvnc.com/en/connect/download/viewer/
Download and install all the softwares in your system and then proceed to furthur steps.
Step 5 – Connecting Raspberry Pi to Laptop
If Pi is connected to laptop with LAN cable directly then follow given steps –
- Open Network and Sharing center of Laptop ( Your laptop will not recognize the raspberry pi connected via ethernet port unless changing some settings ) and click on the WiFi network you are connected.
- Click on the properties and then click on the Sharing tab
- Now click on the sharing tab
- Check on the Box and allow other users to connect to your pc’s internet connection and in Drop down menu select Local Area connection. Click on OK after finishing.
Step 6 – Knowing IP address of Raspberry Pi
⇒ If External display is already connected, you can open terminal in pi and type command “sudo ifconfig” and press enter. Network details of raspberry pi will be shown –
- The IP address of the ethernet port will be shown at the place as Marked in above picture. Here it is 192.168.137.205. Make note of YOUR IP address for further use. After this, you can directly jump to Next step.
⇒ If you don’t have a display now, don’t worry. Let the Raspberry Pi be connected to the laptop via Ethernet Cable and follow steps as given –
- Open the Network and sharing centre and Now click on the Local Area Connection by Unidentified Network
- Click on the Properties tab and then Double Click on the option of ( Internet Protocal Version 4 )
- A Window with IPv4 properties will open. Note the IP address written in the first box and close that Window.
- IP address will be in the range of that only ( In my case, it showing 192.168.137.1 i.e IP address will be in Range of 192.168.137.1 to 192.168.137.255 )
- Now Open the software Angry IP scanner and enter the Range of IP address in which you want to scan for IP ( Note : You just have to vary the last 3 digits of the IP address from 1 to 255, remaining first 9 digits will remain same. In my case 192.168.137 will remain same as it was shown in IPv4 properties )
- After entering the proper IP range, click on the start button to scan for any alive host in that IP range
- Software will start searching for the hosts alive in that IP range.
- After scanning is done, search for search for host name “raspberrypi.mshome.net” and note carefully the IP address associated with it.
- Here the IP adress is – 192.168.137.214
– Note the IP address of the RaspberryPi
Step 7 – Connecting to Raspberry Pi using SSH with PuTTY
Open the PuTTY Software. A PuTTY Configuration window will open up.
- Enter the IP address of Raspberry Pi at the given space.
- Below that, make sure that SSH option is selected.
- And then without changing any settings click on open button.
- A PuTTY security alert window will open. Click on “Yes” to proceed.
Congratulations! Now we have established a connection between Pi and Laptop
- A window asking for login credentials for RaspberryPi will open, You have to Enter username first, then press enter and then password for logging in to Raspberry Pi. ( By Default Username is “pi” and password is “raspberry“ )
- Congratulations! Now you have entered inside the terminal of raspberry pi.
- Now to view the Pi’s screen, type a command “vncserver”. It will turn on the vnc server of raspberry pi.
- Also, note the VNC Desktop address i.e generated after turning on the vnc server
- Here it is – 192.168.137.124:1
Step 8 – Viewing Raspberry Pi using VNC viewer
- Open VNC viewer in your laptop and enter the VNC address in the top bar and press enter. ( VNC address was generated in the last step )
*Don’t forget to put :1,:2,:3 ( as shown in PuTTY ) as mentioned in VNC address
- An Identity Check window will appear. Click on contine to move further.
- In next step, it will ask for authentication
- Enter the Username and password of Raspberry Pi for login and press on Enter.
- This is how Rasberry Pi screen will appear.
Congratulations, you have successfully displayed the Raspberry Pi’s screen on your laptop. You can use Laptop’s Display, Touchpad and Keyboard as Output and Input devices for pi.
Hope that you would have liked it. For any Querry, you can leave a comment below : – )