Skip to content

Instantly share code, notes, and snippets.

@MortezaJavadian
Last active September 27, 2025 13:25
Show Gist options
  • Select an option

  • Save MortezaJavadian/9f440e10ff807b04186c89dfcfe0b0a9 to your computer and use it in GitHub Desktop.

Select an option

Save MortezaJavadian/9f440e10ff807b04186c89dfcfe0b0a9 to your computer and use it in GitHub Desktop.
A complete guide to setting up Remote Desktop on Ubuntu with GNOME using xRDP. Covers installation, configuration, and connecting from Windows and support some problems in NOTE.

Linux Remote Desktop (xRDP with GNOME)

RDP (Remote Desktop Protocol) is a Microsoft software that lets you remotely control another computer with a graphical interface. Windows already comes with an RDP client built-in (Remote Desktop Connection, mstsc).
Now, we will enable that on Linux by installing and configuring xrdp.

Installation & Setup on Ubuntu

1. Install xrdp

sudo apt install xrdp -y

2. Add xrdp User to SSL-Cert Group

This gives xrdp access to SSL certificates for secure connections:

sudo adduser xrdp ssl-cert

3. Configure Firewall

If firewall is enabled, allow RDP traffic on port 3389:

sudo ufw allow 3389/tcp

4. Fix GNOME Black Screen

GNOME needs extra permissions for color management and other services. Without this, you may get a black screen after login.
Create a new PolicyKit rule with just use this commad:

cat <<EOF | sudo tee /etc/polkit-1/rules.d/02-allow-colord.rules
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.color-manager.create-device" &&
        subject.isInGroup("{ssl-cert}")) {
        return polkit.Result.YES;
    }
});
EOF

5. Restart xrdp

sudo systemctl restart xrdp

6. Check xrdp Status

sudo systemctl status xrdp

If the output shows active (running), then xrdp is working.

7. Connect from Windows

  1. Open Remote Desktop Connection (mstsc).
  2. Enter your Ubuntu server’s IP address and click Connect.
  3. On the xrdp login screen, select Xorg as the session type.
  4. Enter your Linux username and password.
  5. You should now see your Ubuntu GNOME desktop.

NOTE

  • If you see a blue frozen screen after login:
    Press the Windows key on your keyboard to open the search menu and work from there.

  • If you get disconnected right after login:
    When you connected with rdp, sometimes after logging out, the session does not close. When you try to reconnect, xrdp immediately kicks you out. you can reboot your linux system to fix this problem, it clears the leftover session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment