How to Access Raspberry Pi With Remote Desktop Software
This article will introduce several methods to access your Raspberry Pi device using remote desktop software.
Using X11 Forwarding Over SSH for Remote Desktop on Raspberry Pi
The X11 forwarding over SSH is a simple solution for accessing Raspberry Pi from another Linux-based environment.
Since the X Window System is widely available on Linux systems, we will assume that you’re accessing the Raspberry Pi device from one. Additionally, we believe that you have access to your Raspberry Pi device over SSH.
In the best-case scenario, you would only need to run the following command to use the GUI programs over the SSH connection:
ssh -X pi@192.168.0.123
This command will yield the console access as usual, but you can invoke GUI programs like Mousepad, and the corresponding window will open in the host machine desktop environment.
There are some security implications while using X11 forwarding as specified here. Still, if you’re running the Pi on your local network and only you have access to it, the risk should be minimal for general usage scenarios.
Notice that the previous command may not work if the sshd
configuration file forbids X11 forwarding. In this case, you will need to modify the configuration file at path - /etc/ssh/sshd_config
.
You must include the line X11Forwarding yes
on a single line in this file. Usually, this line is already included in the default sshd
configuration, or the value may be set to no
if someone modified it previously.
You can edit the file contents using any text editor you’re most familiar with, but you’ll need to use the sudo
prefix to elevate privileges.
sudo nano /etc/ssh/sshd_config
#OR
sudo nano /etc/ssh/sshd_config
After you modify or insert the line, save the changes and restart the sshd
service with the following command to enforce a new configuration.
sudo systemctl restart sshd
You should run GUI applications using the first command we demonstrated in this article.
Using RealVNC Remote Desktop Software on Raspberry Pi OS
The RealVNC is a company that provides paid and proprietary remote desktop software based on RFB protocol. Usually, if you have installed the latest Raspberry OS with desktop, RealVNC software is included, and it offers a free subscription for home users with slight limitations.
The RealVNC software has two parts: a VNC Server and a VNC Viewer client. The latter is free for everyone, so you can take advantage of it on any host computer to access the Raspberry Pi remotely.
VNC Server configuration on Raspberry Pi can be done using different methods. One way to enable VNC Server is the raspi-config
command-line utility.
It’s usually located in the Interface Options section, and then you should see the VNC
option in the list. Alternatively, you can open the VNC application from the GUI and configure it in the desktop environment.
RealVNC provides detailed usage scenarios for their software on Raspberry Pi, found on this link.
Other Options for Remote Desktop Software on Raspberry Pi OS
Several third-party options for remote desktop software range from free and open-source to proprietary and paid software. Some popular choices are xrdp as server and Remmina as a client, or TeamViewer as an all-in-one proprietary and free solution.
Founder of DelftStack.com. Jinku has worked in the robotics and automotive industries for over 8 years. He sharpened his coding skills when he needed to do the automatic testing, data collection from remote servers and report creation from the endurance test. He is from an electrical/electronics engineering background but has expanded his interest to embedded electronics, embedded programming and front-/back-end programming.
LinkedIn Facebook