How to Set Up Remote Desktop in Linux

We will see here how to use remote desktop from Windows or GNU/Linux stations to a GNU/Linux X.Org or a Wayland display servers. As we will see it's completly different dependly on which display server we use.

Know your display server

As explained above, depending of your display server, screen sharing configuration won't be the same. So the first thing to do is to identify display server.

std@host:~$ loginctl 
SESSION  UID USER      SEAT  TTY  
      5 1000 std       seat0 tty2
std@host:~$ loginctl show-session 5 -p Type
Type=wayland
Linux terminal $XDG_SESSION_TYPE

Screen Sharing With Wayland Display Server

In Wayland, the native VNC support is broken, so we will use gnome-remote-desktop which offer remote desktop sharing using VNC with PipeWire.

Configuration

Network diagram

Network diagram vnc server and client

Install Softwares

root@host:~# apt install gnome-remote-desktop

Network Configuration

We need to set a network configuration that will be associate later to screen sharing profile.

Gnome Shell Advanced Network Gnome Shell Network Connections Network diagram vnc server and client Gnome Shell Settings Gnome Shell Settings Gnome Shell Settings

Screen Sharing With X.Org / X11 Display Server

With X11 we can use classic VNC Server, so let's see how to do it with x11vnc server.

Configuration

Network diagram

Network diagram vnc server and client

Open Xorg Session

From GDM3 (GNOME Display Manager) we will select Xorg GNOME session.

GDM Open Gnome Xorg

Install Softwares

root@host:~# apt install x11vnc

Network Configuration

Here, we can use classic method and edit /etc/network/interface or use graphical one (see above).

auto ens192
iface ens192 inet static
	address 192.168.1.200
	netwmask 255.255.255.0
	gateway 192.168.1.254
	dns-nameserver 192.168.1.1

Run x11vnc

std@host:~$ echo $DISPLAY
Linux Terminal echo $DISPLAY
std@host:~$ x11vnc -rfbport 5901 -display :1 -auth /var/lib/gdm/:0.Xauth

Connection from the clients

Connect from a Windows host

Now from the Windows host, download a VNC. VNC Viewer is a good one.

VNC Viewer Main Interface VNC Viewer Main Interface VNC Viewer certificate warning VNC Viewer Properties VNC Viewer Properties picture quality high

Connect from a Linux host

We can use anyone of the many VNC Clients available. Example with tigervnc :

root@host:~# apt install tigervnc
std@host:~$ vncviewer 192.168.1.200:5900
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :