This brief tutorial shows students and new users how to connect to Ubuntu 20.04 | 18.04 via Remote Desktop Protocol (RDP).
Xrdp is an open-source Microsoft Remote Desktop Protocol (RDP) implementation allowing you to control a remote computer graphically.
For several reasons, someone may want to connect to Ubuntu Linux via Remote Desktop Protocol (RDP). One common reason is that it allows users to remotely access their Ubuntu desktop or server from another computer, which can be particularly useful for remote work or troubleshooting.
Additionally, RDP provides a graphical user interface (GUI) for Ubuntu, which can be more user-friendly for some users who are not as familiar with the command line interface (CLI).
Overall, connecting via RDP to Ubuntu can be a convenient and efficient way to access and control Ubuntu machines remotely.
When you’re ready, follow the steps below to get it working.
Install xrdp
Since you already have a desktop environment with Ubuntu Desktop edition, simply run the commands below to Xrdp.
sudo apt update sudo apt install xrdp sudo systemctl enable xrdp
To validate that Xrdp is installed, run the commands below:
sudo systemctl status xrdp
That should display similar text as below:
xrdp.service - xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: >
Active: active (running) since Tue 2020-04-28 10:11:52 CDT; 15s ago
Docs: man:xrdp(8)
man:xrdp.ini(5)
Main PID: 2989 (xrdp)
Tasks: 1 (limit: 4657)
Memory: 1.0M
CGroup: /system.slice/xrdp.service
└─2989 /usr/sbin/xrdp
Apr 28 10:11:51 ubuntu2004 xrdp[2986]: (2986)(140239724779328)[INFO ] address [>
Apr 28 10:11:51 ubuntu2004 xrdp[2986]: (2986)(140239724779328)[INFO ] listening>
Connect from Windows 10
Now that the Xrdp server is installed open the Windows Remote Desktop Connection app and connect to the desktop hostname or IP address.
Please make a log out of your current Ubuntu desktop sessions. You can’t be logged in to Ubuntu while connecting via Xrdp.

When logged out of Ubuntu desktop sessions, click Connect to initiate an RDP connection. You’ll be prompted for your Ubuntu login details.
Next, enter your Ubuntu machine account username and password and connect using Xorg.

When your account username and password are confirmed, you should log in to your Ubuntu machine from Windows.

That’s it!
Connecting to the Ubuntu desktop is easy since it already has a desktop environment.
Connecting to Ubuntu Servers
Since servers generally don’t have a graphical interface, you will need to install a minimal one for this to work in a server environment.
Run the commands below to install some necessary packages.
sudo apt update sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils
Next, xrdp user to the sss-cert group by running the commands below:
sudo adduser xrdp ssl-cert
That should get Xrdp installed and ready for connection on Ubuntu servers.
Since most Ubuntu servers don’t have a firewall enabled out of the box, there is no need to worry about firewall blocking connections.
However, if the Ubuntu firewall is enabled, simply run the commands below to allow RDP traffic.
For example, if you’re connecting 192.168.1.0/24 network, then run the commands below:
sudo ufw allow from 192.168.1.0/24 to any port 3389 sudo ufw allow 3389
That’s it!
Conclusion:
This post showed you how to connect via Remote Desktop Protocol (RDP) to Ubuntu 20.04 | 18.04 Desktops and Servers.
If you find any error, please report it in the comment form below.
Thanks,
Leave a Reply