Chapter 1. Remotely accessing the desktop
You can remotely connect to the desktop on a RHEL server by using graphical GNOME applications. The connection depends on how the server is configured. You can use one or more of the following options:
- Desktop sharing
- Allows remote clients to connect to the desktop session of the Linux user that is currently logged in on the server.
- Remote login
- Allows remote clients to open the GNOME login screen, where they can login as a Linux user with the correct credentials.
1.1. Enabling desktop sharing on the server by using GNOME Copy linkLink copied to clipboard!
You can enable a remote desktop connection from a single client by configuring the Red Hat Enterprise Linux server.
Prerequisites
-
The
gnome-remote-desktop
package is installed.
Procedure
Configure a firewall rule to enable access to the server:
firewall-cmd --permanent --add-port=3389/tcp
# firewall-cmd --permanent --add-port=3389/tcp success
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you also configure remote login on the server, the port number for desktop sharing changes. In that case, modify the firewall rule to add port number
3390
instead.Reload firewall rules:
firewall-cmd --reload
# firewall-cmd --reload success
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Open Settings in GNOME.
- Open the System screen.
Select Remote Desktop.
- Set Desktop Sharing to On.
- Optional: To allow the remote user to control your screen, set Remote Control to On.
Set a user name and a password in the Login Details section. Remote clients must enter these credentials when connecting to your desktop from a remote client.
1.2. Configuring GNOME remote login Copy linkLink copied to clipboard!
By activating Remote Login in GNOME, you can allow remote clients to log in to the GNOME session as the Linux users on your system.
Prerequisites
-
The
gnome-remote-desktop
package is installed.
Procedure
Configure a firewall rule to enable access to the server:
firewall-cmd --permanent --add-port=3389/tcp
# firewall-cmd --permanent --add-port=3389/tcp success
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reload firewall rules:
firewall-cmd --reload
# firewall-cmd --reload success
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Open Settings in GNOME.
- Open the System screen.
Select Remote Desktop.
- Click the Remote Login tab in the menu header.
Set Remote Login to On to enable screen sharing.
- Set a user name and a password in the Login Details section. Remote clients must enter these credentials when connecting to this system’s login screen from a remote client.
1.3. Connecting to a remote desktop by using GNOME Copy linkLink copied to clipboard!
You can connect from a Red Hat Enterprise Linux client to a remote desktop server by using the Connections application. The connection depends on the remote server configuration.
Prerequisites
- Desktop sharing or remote login is enabled on the server. For more information, see Enabling desktop sharing on the server by using GNOME or Configuring GNOME remote login.
- For desktop sharing, a user is logged in to the GNOME graphical session on the server.
-
The
gnome-connections
package is installed on the client.
Procedure
- On the client, launch the Connections application.
Click the
button in the top bar to open a new connection.- Enter the IP address of the server.
Choose the connection type based on the operating system you want to connect to:
- Remote Desktop Protocol (RDP)
- Use RDP for connecting to Windows and RHEL 10 servers.
- Virtual Network Computing (VNC)
- Use VNC for connecting to servers with RHEL 9 and previous versions.
- Click .
Verification
- On the client, check that you can see the shared server desktop.
On the server, a screen sharing indicator appears on the right side of the top panel:
You can control screen sharing in the System menu of the server.
1.4. Connecting to a remote desktop session on a headless server for a single user Copy linkLink copied to clipboard!
You can connect to a remote desktop session on a headless server for a single user through RDP (Remote Desktop Protocol). A headless server is a system that operates without a connected monitor. You can initiate and manage a GNOME desktop session to manage servers securely in environments where direct physical access is not available.
The credentials used to access this type of session are different from the system credentials of the user. For example, changing the user password on the host does not update the password used for RDP access.
Connecting to a remote desktop through RDP protocol requires setting up a TLS key and a TLS certificate.
Prerequisites
-
gnome-remote-desktop
package is installed. -
gdm
package is installed. -
freerdp
package is installed. - The session, such as the kiosk session or the workstation session, is installed. For more information, see How to install a graphical user internface (GUI) for Red Hat Enterprise Linux?
- SELinux is running in permissive mode. For more information, see Changing SELinux to permissive mode
Procedure
Create a directory for the self-signed TLS certificate:
mkdir -p ~/.local/share/gnome-remote-desktop
$ mkdir -p ~/.local/share/gnome-remote-desktop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate a self-signed TLS certificate for the RDP service:
winpr-makecert -silent -rdp -path ~/.local/share/gnome-remote-desktop tls
$ winpr-makecert -silent -rdp -path ~/.local/share/gnome-remote-desktop tls
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure GNOME Remote Desktop by using RDP:
grdctl --headless rdp set-tls-key ~/.local/share/gnome-remote-desktop/tls.key grdctl --headless rdp set-tls-cert ~/.local/share/gnome-remote-desktop/tls.crt grdctl --headless rdp set-credentials grdctl --headless rdp enable
$ grdctl --headless rdp set-tls-key ~/.local/share/gnome-remote-desktop/tls.key $ grdctl --headless rdp set-tls-cert ~/.local/share/gnome-remote-desktop/tls.crt $ grdctl --headless rdp set-credentials $ grdctl --headless rdp enable
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Refer
gdrctl
man page for more information.Enable a headless server for single-user service:
systemctl --user enable --now gnome-remote-desktop-headless.service
$ systemctl --user enable --now gnome-remote-desktop-headless.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the headless GNOME session persistently for a single user as root:
sudo systemctl enable --now gnome-headless-session@<your_username>.service
$ sudo systemctl enable --now gnome-headless-session@<your_username>.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<your_username>
with the username of the user for whom you want to start the headless GNOME session.Make
<your_username>.service
persistent across system reboot:sudo systemctl set-default graphical.target
$ sudo systemctl set-default graphical.target
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the session started successfully:
sudo systemctl status gnome-headless-session@<your_username>.service
$ sudo systemctl status gnome-headless-session@<your_username>.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5. Connecting to a remote desktop session on a headless server for multiple users Copy linkLink copied to clipboard!
GNOME Remote Desktop can be integrated with the GNOME Display Manager (GDM) to provide remote login functionality for multiple users through RDP. Remote users authenticate by using a system-wide password, which grants access to the graphical login screen. Users can log in with their individual credentials, enabling secure remote access to the desktop environment.
Connecting to a remote desktop through RDP for multiple users requires setting up a TLS key and a TLS certificate.
Prerequisites
gnome-remote-desktop
package is installed.NoteYou must reboot your system after installing the
gnome-remote-desktop
package.-
gdm
package is installed. -
freerdp
package is installed. - The session, such as the kiosk session or the workstation session, is installed. For more information, see How to install a graphical user internface (GUI) for Red Hat Enterprise Linux?
Procedure
Create a directory for the self-signed TLS certificate as the
gnome-remote-desktop
user:sudo -u gnome-remote-desktop mkdir -p ~gnome-remote-desktop/.local/share/gnome-remote-desktop
$ sudo -u gnome-remote-desktop mkdir -p ~gnome-remote-desktop/.local/share/gnome-remote-desktop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate a self-signed TLS certificate for the RDP service as the
gnome-remote-desktop
user:sudo -u gnome-remote-desktop winpr-makecert -silent -rdp -path ~gnome-remote-desktop/.local/share/gnome-remote-desktop tls
$ sudo -u gnome-remote-desktop winpr-makecert -silent -rdp -path ~gnome-remote-desktop/.local/share/gnome-remote-desktop tls
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Connecting to a remote desktop through RDP for multiple users:
grdctl --system rdp set-tls-key ~gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.key grdctl --system rdp set-tls-cert ~gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.crt grdctl --system rdp set-credentials grdctl --system rdp enable
$ grdctl --system rdp set-tls-key ~gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.key $ grdctl --system rdp set-tls-cert ~gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.crt $ grdctl --system rdp set-credentials $ grdctl --system rdp enable
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Refer
gdrctl
man page for more information.Enable the system remote login service and GDM:
sudo systemctl enable --now gdm sudo systemctl enable --now gnome-remote-desktop.service
$ sudo systemctl enable --now gdm $ sudo systemctl enable --now gnome-remote-desktop.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make
gnome-remote-desktop.service
persistent across system reboot:sudo systemctl set-default graphical.target
$ sudo systemctl set-default graphical.target
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the session started successfully:
sudo systemctl status gnome-remote-desktop.service
$ sudo systemctl status gnome-remote-desktop.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow