How to Connect Raspberry Pi to Laptop Display: Step by Step GuideMandip
Last Friday, when I was tinkering with the Pi 3 in my office, I wondered and tried to connect it to my PC. But for some reason, I failed. Soon the next day, I again tried to connect Raspberry Pi to Laptop at my home and then what? Succeeded! But, the problems that I faced during this setup led me to write this guide for my readers, i.e., Raspberry Pi lovers (You).
Without adding any additional info, let’s get to our topic.
Things you will need:
- A Raspberry Pi board
- A laptop
- An SD card loaded with Raspberry Pi OS
- A Micro USB cable
- Keyboard, mouse, and HDMI display (optional)
Though you can buy all these stuff separately, I recommend you to buy a complete Raspberry Pi starter kit which includes the necessary components. They can help in doing other DIY Raspberry Pi projects quickly and easily.
How will this setup work?
With the help of an Ethernet cable, you will make a connection between a laptop screen and the Pi board. After that, you can view and control the Pi’s desktop onto the laptop. For that, you can also use some third party application like VNC server to connect Raspberry Pi to a laptop.
Such software helps to operate your Pi remotely from a laptop monitor. So you can access your Pi from your laptop from anywhere in your home or office. Moreover, with the wireless connectivity to your laptop, you can get relief from the Ethernet network to access the internet on your Pi.
How to connect Raspberry Pi to laptop?
Now, I will provide a step-by-step instruction guide for connecting your Raspberry Pi to a laptop display. Keep the essentials on your table and start tinkering with me.
Step-1: Set up the Pi
First of all, you need to make initial setup on your Raspberry Pi. Make sure you have a compatible SD card with preinstalled OS. If you don’t have the Operating System installed on the memory card, you can do it manually with the help of NOOBS software and some easy-to-follow steps for installing Raspberry Pi OS on an SD card.
Then, attach the SD memory card to the USB slot of your Pi. Connect the Pi to the laptop using the Ethernet cable and also power it up with a micro USB cable or a power supply adapter. Also connect the keyboard, mouse, and HDMI display if you want. Remember that the external screen only needed to run the Pi for the first time.
Step-2: Connect to the internet
In this step, you will have to connect your Raspberry Pi to the web with the help of an Ethernet cable and internet connection of your laptop.
- Press Windows + S key and type ‘Control Panel.’
- Open it when prompted
- Go to Network and Internet > Network and Sharing Center
- Then, click on the WiFi network
- Go to ‘Properties.’
- In the ‘Sharing’ tab mark the box followed by ‘Allow other network users…’
- Set the network to ‘Local Area Connection.’
When you follow the steps above and make the settings, a Dynamic IP will be assigned to your laptop and other devices connected with it in the same network.
If you want to check the IP address of your laptop, then follow the steps below:
- Press Windows + S key and write ‘Command Prompt.’
- Open the CMD terminal and enter the broadcast address
ping 192.168.137.255 (assuming the IP address as 192.168.137.1 and subnet mask as 255.255.255.0)
- After 5 seconds passed, stop the ping
- Now, you can see the output via; arp –a
You can also check the Raspberry Pi IP address with some easy-to-follow instructions before the setup.
Step-3: Use VNC Server to make the connection between devices
There are two ways to use VNC server software in your Pi;
1) With HDMI display
2) Without HDMI display
We will see both ways.
1) With the help of an HDMI display
Install the VNC server app on your Raspberry Pi device. For this, open the LX-terminal and type the below commands;
$ sudo apt-get update
$ sudo apt-get install tightvncserver
This process will install the software on your Pi.
2) Without using an HDMI display
If you don’t have or do not wish to use an HDMI screen with your Pi, then also you can easily install the VNC viewer on it.
First, you need to download Putty software. Then through SSH and your system configuration settings, you can easily connect the Pi and your laptop. When you get access to your Raspberry Pi command terminal with the help of Putty, enter the command lines above-mentioned to install the ‘Tight VNC‘ software on it.
Once you installed VNC server software on your Pi, and of course, on your laptop, it’s time to run the program.
Open the SSH terminal and type ‘$ vncserver :1’
When you are doing this for the first time, you will be asked to enter a password. Make sure you have a password in eight digits and remember it as it will be used to access your Pi remotely. You can also set a read-only password if you want. Select ‘No’ if you are a beginner or don’t want to make any extra modes in your setup.
Now, take your laptop and set the VNC client to connect and control the Raspberry Pi from it. In the next step, we will see the detailed steps for this process.
Step-4: VNC client setup on laptop
First, install the VNC client software on your laptop from the official source. As you got from the step above, enter the dynamic IP address of the Pi in the software. Remember to denote the port number.
Now, you need to enter the password you set previously while setting up the server side on your Raspberry Pi.
VOILA! It’s DONE! You have successfully connected the Raspberry Pi to your laptop display.
You can remotely access your Pi from your laptop using VNC software only until your Pi is up and running. Once you restart the web server, you need to again connect the client and server side for the VNC software to control your Pi from the laptop. But, you can set the VNC server for automatic start whenever you boot up the Pi. A couple of code-lines and it will be set up.
Open the ‘.config’ folder and create a subfolder named as ‘vncautostart’ and ‘vnc.desktop’ in it. Then, add some lines of text and save the file.
$ cd /home/pi
$ cd .config
$ mkdir autostart
$ cd vncautostart
$ gnome vnc.desktop
Completed! Now, whenever you restart your Raspberry Pi, the application will run automatically and you can straightaway connect your Pi to the laptop and do the tasks you want.
We have turned the laptop display into a Raspberry Pi monitor today! Let me know your thoughts in the comment section below. Also, if there is any other reliable and quick way to make this happen, then do share it with other Pi users here.