RDP is a proprietary protocol developed by Microsoft that allows users to remotely connect to and control a Windows-based computer or server.
xrdp is an open-source implementation of Microsoft’s Remote Desktop Protocol (RDP), allowing users to remotely connect to Linux systems.
Key Features:
- Remote Access: Connect to remote Windows computers or servers.
- Graphical Interface: Access remote desktops with a graphical interface.
- Keyboard and Mouse Control: Control remote computers as if sitting in front of them.
- File Transfer: Transfer files between local and remote computers.
- Encryption: Supports encryption for secure connections (TLS/SSL).
RDP Components:
- RDP Client (Remote Desktop Connection): Software used to connect to remote computers.
- RDP Server (Remote Desktop Services): Software that allows remote connections.
Common Use Cases:
- Remote Work
- Server Administration
- Technical Support
- Virtual Desktop Infrastructure (VDI)
Installation
1) Install the desktop environment
xfce is a lightweight, open-source desktop environment for Linux and other Unix-like operating systems.
sudo apt update
sudo apt install xfce4 xfce4-goodies -y
2) Install xrdp
sudo apt install xrdp -y
3) Check the status
sudo systemctl status xrdp
If it is not running, you can start it using this command:
sudo systemctl start xrdp
4) Create .xsession file
echo "xfce4-session" | tee .xsession
This configuration tells the system to use xfce’s session manager when a graphical login is requested. Since XFCE is your chosen desktop environment, xfce4-session acts as its default session manager.
Without this configuration, no session manager is selected, causing the RDP session to fail when attempting to connect to the graphical display.
5) Restart the service
sudo systemctl restart xrdp
6) Configure the firewall to allow the connection
If you have not setup the firewall yet, check this article: How to setup a firewall in Ubuntu using UFW
Default port for RDP is 3389.
sudo ufw allow 3389
sudo ufw status
7) Test the RDP connection
Now open Remote Desktop Connection on your Windows machine and login to the Ubuntu machine.