[Ubuntu] Installation and Configuration of XRDP

XRDP is a remote desktop service for the LINUX servers which allows us to connect remote Linux desktop systems over Microsoft RDP protocol. XRDP also supports two-way clipboard transfer (text, bitmap, file), audio redirection, and drive redirection (mount local client drives on the remote machines).

To install XRDP, run the following command in the terminal:

Command: apt install xrdp

Allow Remote Access XRDP Ubuntu Techhyme

After installing XRDP, enable the xrdp service by using the following systemctl command:

Command: systemctl enable –now xrdp

Allow Remote Access XRDP Ubuntu Techhyme

To connect with the RDP session you may need to allow the port in firewall which by default is closed. Run the below command to open the port.

Command: ufw enable
Command: sudo ufw allow from any to any port 3389 proto tcp

Allow Remote Access XRDP Ubuntu Techhyme

To test the connection using the Remote Desktop Connection client on Windows, first launch the Remote Desktop Connection app. Enter your remote server’s public IP and username into the fillable text boxes for Computer and User name.

You may need to press the down arrow for Show Options to input the username:

Allow Remote Access XRDP Ubuntu Techhyme

Press the Connect button. If you receive an alert that the Remote Desktop can’t connect to the remote computer, check that you have turned on the Remote Desktop option in your system settings.

Then, enter your remote server’s username and the password you created for user during the initial server setup. Press Ok.

Once you have logged in, you should be able to access your Ubuntu Desktop environment:

Allow Remote Access XRDP Ubuntu Techhyme

Furthemore, default xrdp does not allow root to perform remote desktop connection. So you should have a look at the following file /etc/xrdp/sesman.ini and check if there is any AllowRootLogin option.

Set the value to 1, true or yes to enable root login on terminal server as shown in below screenshot.

Allow Remote Access XRDP Ubuntu Techhyme

In this article, you configured xrdp to connect to a graphical desktop for your remote Ubuntu server over an RDP connection from a local machine.

You may also read:

Leave a Reply