How to connect to raspberry pi remotely
An SSH server can not only provide the command line, but also a graphical user interface that does not necessarily have to look like the one on the remote system.
A display redirection or X-Forwarding can be performed by an SSH server. However, you will not get the current, but your own desktop in this solution.
- Set up display redirection.
- Install panel.
- Connect to the graphical user interface via SSH.
Solution: Setup display redirection
The display redirection is called X-Forwarding. For this to work, the respective SSH server must be configured accordingly. To do this, we open the configuration file:
sudo nano /etc/ssh/sshd_config
There we enter the following line, which should be available by default.
X11 Forwarding yes
Then save and close: Ctrl + O, Return, Ctrl + X.
The SSH server needs to be restarted (only if you have changed the file).
sudo service ssh restart
Solution: install panel
The display redirection is of no help if you do not have a panel (start menu, program bar, …) that allows you to control the desktop. A panel is a control bar, which can be placed anywhere on the desktop and expanded with many applets and plugins. For example, program starter or battery, network or hard disk monitor.
That’s why we first install a panel.
sudo apt-get install lxpanel
Other panels include tint2, fpanel, xfce4-panel, visibility, kicker, barpanel and many more.
Establish raspberry pi connection via SSH
Then you can enter the following command directly in the SSH client.
ssh -X [email protected] lxpanel
The key parameters are “-X” (large X) for display redirection and “lxpanel” for the panel.
The IP address must be adapted according to your own Raspberry Pi.
Alternative: Remote Desktop via RDP
In the Windows world, VNC is less common. This is called remote desktop support via RDP. If you’re working with Windows clients, setting up an RDP server on the Raspberry Pi is a viable alternative to VNC.