Remote Desktop Protocol (RDP) enables users to establish a secure connection to remote computers over a network, allowing them to access files, applications, and system resources as if they were physically present.
Microsoft developed RDP primarily for Windows, but it also works for Linux, macOS, Android, and iOS devices, making it a versatile solution for remote access across different operating systems.
This article will show you how to connect to an Ubuntu system from Windows using RDP.

Prerequisites
- A client Windows machine.
- A host machine with Ubuntu installed.
- Sudo or root privileges on the host machine.
How to Connect to Ubuntu Remote Desktop From Windows
The RDP client is preinstalled on Windows. However, the Ubuntu system must be configured before it accepts incoming RDP connections.
Follow the steps in the sections below.
Install xrdp on Ubuntu
xrdp is an RDP server for Linux that listens for and accepts RDP connections from clients. Ubuntu systems usually do not have xrdp installed by default.
To install xrdp on Ubuntu, take the following steps:
1. Update the Ubuntu packages list:
sudo apt update
2. Install xrdp with the following command:
sudo apt install xrdp -y
3. Check the xrdp server status:
sudo systemctl status xrdp
The output confirms the xrdp is active.
Configure xrdp Port (Optional)
The <strong>xrdp</strong>
server listens for incoming RDP connections on port number 3389. Using a non-standard port for RDP connection is a form of protection through obscurity. It is not a robust security measure, but it protects a system from rudimentary brute-force attacks.
To instruct xrdp to listen on a different port, take the following steps:
1. Use a text editor, like Vim, to edit the xrdp configuration file, xrdp.ini:
sudo vim /etc/xrdp/xrdp.ini
2. Locate the port
directive in the [Globals] section and set the desired value. In this example, the RDP port is 49952
:
port=49952
3. Save the changes and exit the file.
4. Restart the xrdp server to apply the changes:
sudo systemctl restart xrdp
There is no confirmation message after the server restarts.
Open a Port for Incoming Traffic in ufw
An active firewall on the Ubuntu system, such as ufw, can block traffic on specific ports. Configure the firewall and allow traffic on the desired port to ensure successful RDP connections.
Note: Several tools can help you check open ports in Linux.
Take the following steps:
1. Check the ufw firewall status:
sudo ufw status
If the firewall is inactive, use the following command to turn on ufw:
sudo ufw enable
2. Allow traffic on port 3389
or choose a different port for your RDP connection. The following command allows RDP connections on port 49952
:
sudo ufw allow 49952/tcp
Modify the command to open a different port number for RDP connections.
3. Reload the ufw firewall tool to apply the changes:
sudo ufw reload
Note: If you want to access the Ubuntu machine from outside its local network, configure port forwarding on the router or adjust external firewalls.
Configure Remote Desktop Connection on Windows
To initiate an RDP connection to a remote Ubuntu system from Windows, take the following steps:
1. Type rdp in the Windows search box.
2. Open the Remote Desktop Connection app.
3. Enter the IP address or name of the remote Ubuntu system in the Computer field.
If you change the default port number for RDP connections on Ubuntu, enter the port number after the IP address in the following format:
IP_address:port_number
Note: Consult the following article if you need help finding IP addresses in Linux.
4. Type the username of the Ubuntu user for the RDP connection.
5. (Optional) Save the connection details for future use.
6. (Optional) The Remote Desktop Connection (RDP) app in Windows enables users to configure the RDP session. The main configuration options are split into several sections:
- Display. Adjust the size and color settings of the remote desktop window.
- Local Resources. Decide which local devices (keyboards, audio, and printers) to share with the remote system.
- Experience. Modify visual effects like desktop background and font smoothing based on network speeds.
- Advanced. Fine-tune server authentication settings, set up a Remote Desktop Gateway server, and more.
7. Click Connect.
Log in to Ubuntu System
Enter the password for the Ubuntu RDP user and click OK.
You are now able to interact with the Ubuntu machine via the established RDP session.
Ubuntu RDP From Windows: Extra Tips + Best Practices
To set up a smooth and secure RDP connection from Windows to Ubuntu, focus on more than basic configuration. Optimize hardware, internet speed, and security settings to improve performance and responsiveness.
The following text explains best practices and useful tips for RDP from Windows to Ubuntu.
Minimum vs. Optimal Hardware Requirements
The RDP connection quality from Windows to Ubuntu depends on the system's hardware capabilities and the type of tasks and applications running on the Ubuntu system.
The Ubuntu system should meet the following requirements:
REQUIREMENTS | MINIMAL | RECOMMENDED |
---|---|---|
CPU | Single-core 1 GHz+ | Dual-core 2 GHz+ |
RAM | 2 GB+ | 8 GB+ |
Storage | 25 GB+ | 50 GB+ (SSD) |
Network | Basic NIC | Stable broadband (Ethernet NIC) |
Graphics | Integrated graphics or entry-level GPU | Dedicated GPU |
Ideal Internet Speed for RDP Connections
Certain tasks require a minimal level of responsiveness and visual quality. The table offers an overview of minimal and recommended bandwidth per connection for general RDP tasks:
Tasks | LOCAL NETWORK | INTERNET |
---|---|---|
Text editing | 1 Mbps | 1 Mbps |
Web browsing | 5 Mbps | 2-5 Mbps |
Video streaming | 10-15 Mbps | 5-10 Mbps |
Beyond bandwidth, factors such as server load, network latency, and packet loss impact RDP performance. For the best experience, prioritize low-latency connections and stable network conditions.
xrdp Black Screen Issue Troubleshooting
Users sometimes encounter a black screen when using xrdp with specific Ubuntu configurations. The screen appears after establishing an RDP session and prevents users from interacting with the Ubuntu system.
To try and resolve the black screen issue, use the tips from the sections below.
Check Log Files
Log files provide valuable information about potential errors. Access the /var/log/xrdp.log using the following command:
sudo vim /var/log/xrdp.log
Look for warnings and error messages on the log timeline.
The /var/log/xrdp-sesman.log file contains entries about session startups and shutdowns, operational messages, and warnings. Use the following command to access the log:
sudo vim /var/log/xrdp-sesman.log
Check for errors occurring when a new session is initiated and for other backend-related issues.
Set max_bpp in xrdp.ini File
The bits per pixel (bpp) value defines the number of bits used to represent the color of a single pixel. High bpp values increase the data that needs to be transferred, which affects performance and causes compatibility issues.
Use the following command to access the xrdp.ini configuration file and check the max_bpp
value:
sudo vim /etc/xrdp/xrdp.ini
Set the max_bpp
value in the [Globals] section to 24
, as the default value of 32
bpp sometimes causes issues. If there are other max_bpp
values under individual sections, adjust them as well.
Save the changes and restart the xrdp service to ensure the changes take effect.
Reinstall xrdp
A straightforward way to resolve configuration or compatibility issues is to reinstall xrdp.
Run the following to remove the xrdp package and delete its configuration files:
sudo apt remove --purge xrdp -y
Initiate a fresh xrdp installation from Ubuntu repositories with:
sudo apt install xrdp -y
After the installation, modify the xrdp configuration files again.
Install a Different Desktop Environment
The default Ubuntu GNOME desktop occasionally has compatibility issues with xrdp. Install an alternative Ubuntu GUI, such as the XFCE desktop environment, and attempt to establish an RDP connection.
Security Measures
Secure an RDP session from Windows to Ubuntu to prevent unauthorized access and data breaches. Proper security measures include hardening the Windows client and Ubuntu host, restricting network access, and enforcing strong authentication policies.
The following sections present key steps to enhance security.
Windows
- Update Windows regularly to ensure the Remote Desktop Connection app is up-to-date with the latest security patches.
- Limit the number of simultaneous active RDP sessions.
- Disconnect from an RDP session when it is not being used and set timeouts for idle sessions.
Network
- Use a firewall to restrict RDP access to specific IP addresses.
- Change the default RDP port (3389) to a non-standard port number.
- Use a VPN to encrypt the data transfer between client and host machines.
- Alternatively, use SSH port forwarding to create an encrypted tunnel for the RDP session if a VPN is not an option.
Linux
- If you use xrdp, edit the /etc/xrdp/sesman.ini file to specify which users can establish an RDP connection.
- Create dedicated accounts for RDP to restrict access to critical systems or data.
- Implement two-factor authentication for RDP sessions. xrdp does not natively support 2FA but can be integrated with other authentication tools.
- Temporarily lock user accounts after multiple unsuccessful login attempts.
- Enforce strong password policies for RDP user accounts.
Note: To ensure your passwords meet the highest security standards, check out our selection of strong password ideas or use our free password generator.
Reduce Resolution and Color Depth for Performance Boost
Enhance the RDP session performance by adjusting the color depth and screen size from the Windows RDP client.
To reduce the resolution and color depth, access the Remote Desktop Connection app and:
1. Open the Display tab.
2. Drag the Display configuration slider left to reduce the resolution. For optimal performance on slower connections, 1280x720 resolution is a good choice.
3. Expand the dropdown in the Colors section and choose High Color (16-bit) to reduce the color depth.
Reducing the screen size and color depth is especially beneficial for low-bandwidth or unreliable network connections.
Conclusion
This tutorial explained how to initiate an RDP session from your Windows system to a remote Ubuntu machine. It also elaborated on useful tips and best practices for a high-quality and secure connection.
Next, learn how to SSH to a remote server from Windows, Linux, or Mac.