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.
sudo apt install xrdp -yThis gives xrdp access to SSL certificates for secure connections:
sudo adduser xrdp ssl-certIf firewall is enabled, allow RDP traffic on port 3389:
sudo ufw allow 3389/tcpGNOME 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;
}
});
EOFsudo systemctl restart xrdpsudo systemctl status xrdpIf the output shows active (running), then xrdp is working.
- Open Remote Desktop Connection (
mstsc). - Enter your Ubuntu server’s IP address and click Connect.
- On the xrdp login screen, select Xorg as the session type.
- Enter your Linux username and password.
- You should now see your Ubuntu GNOME desktop.
-
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.