Step-by-Step Installation Guide
Step 1: Update Your System
First, make sure your system is up to date. Open your terminal and run the following commands:
sudo apt update
sudo apt upgrade -y
Step 2: Install XRDP
Next, install XRDP by running the following command:
sudo apt install xrdp -y
Step 3: Install a Desktop Environment
XRDP requires a desktop environment to function. If you don’t have one installed, you can install Xfce, a lightweight desktop environment:
sudo apt install xfce4 xfce4-goodies -y
Step 4: Configure XRDP to Use Xfce
Now, configure XRDP to use the Xfce desktop environment. Create or edit the ~/.xsession file and add Xfce to it:
echo xfce4-session ) ~/.xsession
Then, configure XRDP to use this file by editing the /etc/xrdp/startwm.sh file:
sudo nano /etc/xrdp/startwm.sh
Find and replace these lines at the end of the file:
[ORG]
exec startxfce4
Save and close the file (Ctrl+X, then Y, then Enter).
Step 5: Enable and Start XRDP
Enable the XRDP service to start on boot, and then start the service:
sudo systemctl enable xrdp
sudo systemctl start xrdp
Step 6: Adjust Firewall Settings
If you have a firewall enabled, you need to allow traffic on port 3389, the default port for RDP:
sudo ufw allow 3389/tcp
Step 7: Connect to Your Ubuntu Machine
Your XRDP server is now ready. To connect, use an RDP client like Remote Desktop Connection on Windows or Remmina on Linux. Enter the IP address of your Ubuntu machine and connect.