Maker Pro
Raspberry Pi

How to Connect a Raspberry Pi to a Laptop Display | Headless Setup

March 21, 2018 by Aqib _
Share
banner

Updated for latest Raspbian on Raspberry Pi 3, 3B+ and 4. A simple method to use laptop as Raspberry Pi display.

Headless setup.jpeg

I came up with this tutorial one day when my friend Suvigya and I were struggling to work on the Raspberry Pi, because we did not have any HD displays. Hence, I came up with this tutorial so others in the same situation would be able to use their laptop display as a monitor for their Raspberry Pi.

As we know, Raspberry Pi is known as the “Pocket-Size PC”, but for debugging and project purposes it's cumbersome to carry an additional display for it. Also, many of us don't have access to an HDMI display, so, we figured out a way to easily connect a Raspberry Pi to a laptop display. Sit back and enjoy this simple tutorial!

Connect raspberry pi to laptop.jpeg

How Does It Work?

To connect a Raspberry Pi to a laptop display, we can simply make use of WiFi. The Raspberry Pi’s desktop GUI (Graphical User Interface) can be viewed through the laptop display using a wireless connection between the two. There are many software programs available that can establish a connection between a Raspberry Pi and our laptop. We used VNC software to connect the Pi to our laptop.

Installing the VNC server on our Pi allows us to see the Raspberry Pi’s desktop remotely, using the mouse and keyboard as if we were sitting right in front of our  Pi. It also means that we can put our Pi anywhere else in our home and still control it. 

1- Download Raspbian Image

Before moving to connect our Raspberry Pi to our laptop display, we need an SD card with the OS installed. Many operating systems are available for the Raspberry Pi and most are focused around Linux, but the most popular version is Raspbian. This OS not only provides a fully functional desktop environment with commonly used programs such as chromium and word processing, but it also includes a wide range of programming tools. Since 2015, the Raspberry Pi Foundation has declared Raspbian as the primary operating system for Raspberry Pi and is open source.

To get this OS, go to the Raspbian download page and download the latest Raspbian from there. At the time of updating this tutorial, the latest version is Raspbian Buster.

There are multiple options, but we want to download the fullest featured version. In this case, that version is the Raspbian Buster with desktop and recommended software. You can download either the torrent or the ZIP.

raspbian buster.png

2- Write the Raspbian Image to SD card

While the Raspbian image downloads, we also need to download a program called Win32 Disk Imager, which writes the Raspbian image to our microSD card. 

win32 disk imager.png

Run the installer for Win32 Disk Imager first and then load the program. Once Raspbian finishes downloading, extract the file, go into Win32DiskImager, and select this file in the Image File input box.

write raspbian to sd card.png

    Before you can flash the microSD card, you need to ABSOLUTELY make sure that the device dropdown box is the same as the microSD card drive. In this case, my microSD card reader showed up as 'F' drive and therefore I selected this from the list. With everything configured it’s time to write the image to the microSD card so go ahead and click the “write” button.

    3- Add additional file to enable SSH and connect to WiFi on Boot

    Once the image has been written, Raspbian OS is installed. Now we need to add some more files in the SD card that will enable SSH and will connect to WiFi on the boot.
    Create a file named  "wpa_supplicant.conf" and place the below code with your country code, WiFi name, and password. This will connect your Raspberry Pi to the WiFi network.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=PK #Your country code

network={
        ssid="My_WiFi" #Your WiFi Name
        psk="123456789"	#Your WiFi password
        key_mgmt=WPA-PSK
}

Next, create an empty file and name it as "ssh" without any extension. This will enable SSH on Raspberry Pi and we will be able to connect to it from our PC.

enable ssh and create wifi config file.png

Now insert the SD card in your Raspberry Pi and power on your Pi.

4- Finding Raspberry Pi's IP Address

To find out the IP address of Raspberry Pi, we will use advanced IP Scanner. Download Advanced IP Scanner, install and open it.

Press on the "Scan" button and it will show you the IP address of your Raspberry Pi along with other devices connected to this network. Your IP address will be different than mine. Note this IP address as we will need in the next step.

ip scanner.png

5- SSH into Raspberry Pi

To SSH into Raspberry Pi, we will have to use PuTTY software.

Download and install PuTTY software on your PC.

Open it, type the IP address of your Raspberry Pi (We got in the last step) and click on open.

putty.png

Next, it will give a security alert. Click on 'Yes' as we know the host we are connecting to.

security.png

After that, it will ask for username and password. Default username is 'pi' and password is 'raspberry'.

login.png

6- Enable VNC and set Resolution

Now we have successfully SSH into the Raspberry Pi and we have to enable VNC so that we can use mouse and keyboard to control it.

Type following command to open configuration tool.

sudo raspi-config

Go to interfacing options.

interfacing option.png

Select VNC and enable it.

enable VNC.png

Next, we need to set a resolution for our Raspberry Pi. So go to "Advanced Options".

advanced options.png

Then go to "Resolution".

resolution.png

And select a resolution other than default.

select resolution.png

Finish and reboot.

finish and reboot.png

7- VNC Viewer on Client Side

Now we have to install VNC viewer on our PC so that we can view and control it the Raspberry Pi from our PC. Download and install VNC viewer and install it.

Open it and type the IP address of your Raspberry Pi in it. It will ask for username and pass. The default username is 'pi' and the password is 'raspberry'.

vnc viewer.png

Click on 'OK' and Finally, the Raspberry Pi desktop should appear as a VNC window. We will be able to access the GUI and do everything as if we were using the Pi’s keyboard, mouse, and monitor directly.

vnc.png

If you are facing any problems, feel free to ask in the comment section.

Author

Avatar
Aqib _

For Custom Projects, hire me at https://www.freelancer.pk/u/Muhammadaqibdutt

Related Content

Comments


You May Also Like