By Calabastro
If you have spent years in system administration or IT support, you know the comfort of the Windows Remote Desktop Protocol (RDP). It offers a seamless bridge between your workstation and a serverโcomplete with clipboard sharing, drive mapping, and that familiar window management feel.
However, managing Linux servers often forces you to switch contexts: opening SSH terminals, relying heavily on command-line tools like htop or top, and occasionally wrestling with VNC (Virtual Network Computing). While VNC is a powerful tool, it often feels clunky compared to the polished experience of RDP.
What if you could manage your Ubuntu or Debian Linux servers with the exact same familiarity as your Windows Server instances?
In this guide, we will set up XRDP (eXtended Remote Desktop Protocol) paired with the GNOME Desktop Environment. This allows you to use the native Microsoft “Remote Desktop” client on your PC to control a headless Linux machine just like it were another piece of Windows hardware.
Why XRDP over VNC?
Before we dive into the terminal, let’s discuss why this setup is often preferred for server management:
- Performance: RDP generally requires less bandwidth than VNC, making it much smoother over slow or high-latency internet connections.
- Client Familiarity: Every Windows machine has an RDP client installed by default. You don’t need to download third-party viewers like TightVNC or TigerVNC.
- Feature Set: Native clipboard integration and drive redirection (accessing your local C: drive from the remote server) are much easier to configure.
Prerequisites
To follow this guide, you will need:
- A Linux Server: Ubuntu Server (20.04, 22.04, or 24.04 LTS) or Debian 11/12.
- Root/Sudo Access: You must have administrative privileges.
- GNOME Desktop Environment: This guide assumes you are installing the desktop on the server (headless setup).
- A Windows Workstation: The machine from which you will remote in.
Step 1: Update and Install GNOME
If your Linux installation is currently a bare-bones server with no graphics, we need to install the desktop environment first. While KDE or XFCE are lighter, GNOME provides the most polished “modern OS” feel similar to Windows 10/11.
Connect via SSH and run the following updates:
sudo apt update
sudo apt upgrade -y
Now, install the Ubuntu Desktop package (which works for Debian as well):
sudo apt install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y
Note: During installation on Debian, you may be prompted to choose a display manager. Select gdm3.
Step 2: Installing XRDP
Now we install the server-side software that will translate the GNOME interface into RDP packets.
sudo apt install xrdp -y
Once installed, the XRDP service usually starts automatically. However, to be safe and ensure it runs at boot:
sudo systemctl enable xrdp
sudo systemctl start xrdp
Step 3: Configuring GNOME for XRDP (Crucial Step)
This is the most common point of failure. By default, GNOME often tries to launch a “Wayland” session when a user logs in locally or remotely. XRDP does not support Wayland. It requires Xorg. If you try to connect right now, you will likely get a black screen or an immediate disconnect.
We must force GNOME to use the X11 (Xorg) session specifically for XRDP. We do this by creating a specific session file in the user’s home directory.
Open the .xsession file in your text editor (replace username with your actual username):
sudo nano /home/username/.xsession
Note: The . at the beginning hides the file; this is correct behavior.
Paste the following configuration into the file:
export XDG_CURRENT_DESKTOP=GNOME
export XDG_SESSION_TYPE=x11
exec gnome-session
Save and exit (Ctrl+O, Enter, then Ctrl+X in nano). Now ensure the file has executable permissions so the system can run it upon connection:
sudo chmod +x /home/username/.xsession
(If you have multiple users who need access, you must repeat this step for each user’s home directory, or simply copy the configuration to /etc/skel/.xsession to apply it automatically to new users.)
Step 4: Firewall Configuration
XRDP listens on port 3389. If you are running a firewall (UFW is standard on Ubuntu/Debian), you must open this port or the connection will time out.
Check your firewall status:
sudo ufw status
Enable port 3389:
sudo ufw allow 3389/tcp
Security Tip: For a production environment, it is highly recommended to tunnel RDP over SSH rather than opening port 3389 to the entire public internet. However, for local network management, opening the port is standard practice.
Step 5: Connecting from Windows
You are now ready to bridge the gap.
- On your Windows machine, open the Start Menu and type “Remote Desktop Connection”, then launch it.
- In the Computer field, enter the IP address of your Linux server (e.g.,
192.168.1.50). - Click Connect.
You will be presented with an XRDP login screen. It will look slightly different than a standard Windows RDP screenโusually gray or dark grey.
- Session: Ensure “Xorg” is selected in the dropdown (if it doesn’t default correctly).
- Username: Enter your Linux username.
- Password: Enter your Linux password.
Once authenticated, XRDP will load the GNOME desktop environment you installed earlier. You can now manage your server using a mouse and keyboard, open a terminal, or edit configuration files with text editors just like you would on Windows.
Troubleshooting Common Issues
“I get connected but it turns black immediately.”
This is almost always the .xsession issue described in Step 3. Ensure export XDG_SESSION_TYPE=x11 is present and that you have logged out of the GNOME desktop on the physical server (or via another SSH session) before trying the RDP connection again.
“The mouse cursor moves weirdly / doesn’t match.”
Adjust the display settings within your remote GNOME session. Right-click the desktop -> Display Settings. Ensure the resolution is set to a value supported by your local machine.
“I can’t type my password correctly (keyboard layout issues).”
This happens if your Windows client uses a different keyboard layout than the Linux server. Usually, simply logging out and back in fixes this, but you may need to configure /etc/default/keyboard on the server to match your physical keyboard (e.g., xkb-model="pc105").
Final Thoughts
Managing a Linux server does not have to mean staring at a blinking cursor forever. By bridging the gap with XRDP and GNOME, you gain the performance of a Linux kernel combined with the accessibility and familiarity of Windows Remote Desktop. It allows for easier maintenance of desktop-centric tools, graphical file managers (Nautilus), and web development environments without leaving your workstation’s comfort zone.
Welcome to the hybrid server environment!
