Connect to a Windows PC from Ubuntu using RDP

By
Vladimir Kaplarevic
Published:
February 27, 2025
Topics:

The Remote Desktop Protocol (RDP) allows users to connect to another computer across a network and take remote control over the host machine.

The remote desktop connection is possible between different platforms, e.g., Linux users are able to RDP into a Windows system and vice versa.

Learn how to RDP to a Windows PC from your Ubuntu system in minutes.

how to connect to a windows pc from ubuntu using rdp

Prerequisites

  • Ubuntu system.
  • Sudo or root privileges.
  • A remote Windows machine with network connectivity.
  • Windows firewall set to allow incoming RDP connections.
  • The user account intended for the RDP session with RDP permissions on the Windows system.

How to Connect to a Windows PC From Ubuntu

The Ubuntu (client) and Windows (host) systems must be configured before establishing an RDP connection. This configuration ensures the Windows system allows remote desktop connections and the Ubuntu client has the necessary software to initiate the connection securely.

Enable Remote Desktop Connection on the Windows Computer

Incoming RDP connections must be enabled on the Windows system. There are two ways to enable RDP in Windows.

Option 1: Enable RDP in Settings

To enable RDP in Windows settings, take the following steps:

1. Open the Windows Start menu and select Settings.

Settings in Windows start menu

Note: Alternatively, press Winkey+I to access the Settings app.

2. Select System.

Select System

3. Scroll down and locate Remote Desktop in the menu.

Choose Remote Desktop

4. Toggle the Enable Remote Desktop switch On.

Toggle the Remote Desktop switch On

5. Click Confirm.

Click Confirm

6. Close the Settings menu.

Note: When enabling RDP, ensure the user account initiating the connection has RDP permissions and the firewall allows RDP connections.

The Windows PC now accepts RDP connections.

Option 2: Enable RDP from Windows CMD

Activating RDP via the Windows Command Prompt (CMD) is useful when automating RDP setups across multiple Windows machines or creating scripts to streamline the configuration process.

To accomplish this, take the following steps:

1. Type cmd in the Windows search box.

2. Select Run as administrator to open the Command Prompt with administrative privileges.

cmd Run as an Administrator

3. The reg command modifies the Windows Registry. Enter the following command to enable RDP:

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f cmd output

Warning: Exercise caution when making changes to the Windows Registry. Incorrect modifications harm your system.

4. This part is optional, but if the Windows Firewall is activated, use the following command to enable RDP connections:

netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes cmd output

Note: The user account used to establish the connection must have RDP permissions on the Windows machine, and the Windows firewall must allow RDP connections.

The Windows system is ready to accept RDP connections.

Install Desktop/GUI Environment on Ubuntu (Optional)

Users running Ubuntu Server or a minimal installation of Ubuntu without a graphical user interface (GUI) often use command-line-based RDP clients, such as FreeRDP. However, some RDP clients like Remmina do not work without a GUI.

Installing a GUI on Ubuntu, such as Ubuntu GNOME, KDE Plasma, LXDE, or XFCE, provides a more intuitive and user-friendly environment for establishing RDP connections.

To install the GNOME desktop environment:

1. Update the Ubuntu packages list:

sudo apt update

2. Enter the following command to install GNOME:

sudo apt install ubuntu-desktop -y

3. Reboot the system:

sudo reboot

Once you log in to the Ubuntu system, you are presented with a desktop environment.

Ubuntu 24.04 GNOME desktop.

Next, install and launch your preferred RDP client to connect to the Windows system.

Install Remote Desktop Client Software on Ubuntu

Linux users utilize RDP clients such as Remmina, FreeRDP, or others to facilitate an RDP connection.

The following text presents how to install remote desktop client software on Ubuntu.

Option 1: Install Remmina Client on Ubuntu

Remmina is the default RDP client on newer Ubuntu systems. To check if the Remmina client is installed, use dpkg piped with grep:

dpkg -l | grep remmina
dpkg -l | grep remmina terminal output

The system displays a list of installed Remmina packages and plugins. If the Remmina client is not installed, take the following steps:

1. Update the Ubuntu packages list:

sudo apt update

2. Install Remmina and the necessary plugins:

sudo apt install remmina remmina-plugin-rdp -y
sudo apt install remmina remmina-plugin-rdp -y terminal output

3. Launch the RDP client by entering the following command:

sudo remmina

4. Click the top left + icon to add a new connection profile.

Add a new RDP connection profile in Remmina.

5. Enter a connection profile Name. For example, Windows PC Connect.

Remmina choose Remote profile name

6. Select RDP - Remote Desktop Protocol from the Protocol dropdown menu.

Remmina Choose Remote Connection Protocol

7. Enter the IP address or hostname of the Windows machine in the Server field.

Remmina Add IP Address

Note: Find the IP address of the Windows machine using the ipconfig command. Look for the IPv4 Address under your active network connection.

8. Define the username and password for the user account you plan to use to log into the Windows machine.

Remmina Define the username and password

Note: This user should be granted RDP permissions on the Windows host.

9. Select Use client resolution or define a custom resolution in the Resolution field.

10. Leave the Colour depth set to Automatic. This preference allows the server to choose the best format based on network speed.

These are the mandatory options for initiating a standard RDP session. The Remmina client has numerous advanced settings to customize how the RDP connection is established.

11. Click Save and Connect to save the profile and connect to the Windows machine using the profile details.

Click Save and Connect in Remina

Note: If you receive a certificate warning, opt to trust the (legitimate) certificate to continue with the connection.

The remote Windows desktop is available in the Remmina dashboard.

RDP access to Windows from Ubuntu

The next time to RDP into the Windows system, launch Remmina and double-click the saved profile.

Option 2: Install FreeRDP Client on Ubuntu

FreeRDP is an open-source Remote Desktop Protocol (RDP) client that allows Ubuntu to connect to Windows using the terminal. It is often preferred over graphical clients like Remmina for its flexibility, lower resource usage, and ability to be scripted for automation or remote administration.

To install the FreeRDP client on Ubuntu:

1. Update the Ubuntu packages list:

sudo apt update

2. Install the FreeRDP client using the following command:

sudo apt install freerdp2-x11 -y
sudo apt install freerdp2-x11 -y terminal output

3. Establish the RDP connection using the following syntax:

sudo xfreerdp /v:windows_machine_ip /u:username

Replace windows_machine_ip and username with valid connection details. In this example, those are:

sudo xfreerdp /v:192.168.56.1 /u:PC

If the password /p: option is not included in the command, xfreerdp prompts for the RDP user password. This practice is more secure than entering the password within the command.

Note: To find the windows_machine_ip, run the ipconfig command. Moreover, to find username, run echo %USERNAME% in the command prompt.

Once connected via FreeRDP, the user gains access to the remote Windows system in a graphical interface.

FreeRDP connection

The xfreerdp command-line tool is part of the FreeRDP project and offers multiple options for connecting to RDP servers:

OPTIONDESCRIPTION
/p:[password]Specifies the user's password.
/domain:[yourdomain]Specifies the domain for authentication.
/fEnables fullscreen mode.
/size:[1366x768]Specifies a custom screen resolution.
/port:[4309]Specifies a port number other than the default 3389.

Ubuntu RDP to Windows: Extra Tips + Best Practices

To ensure a secure Remote Desktop Protocol (RDP) connection from Ubuntu to Windows, carefully consider performance and security settings. By optimizing hardware, network speed, and display settings, users enhance responsiveness and reduce lag during remote sessions.

The sections below offer advice on how to achieve optimal results when connecting to Windows using RDP on Ubuntu.

Minimum vs. Optimal Hardware Requirements

The RDP experience depends on bandwidth, network latency, and the capabilities of the Windows host machine. The table below outlines the minimal and optimal requirements for the Ubuntu and Windows systems:

HardwareUbuntu Client
Minimal / Optimal
Windows Host
Minimal / Optimal
CPUDual-core processor / Multi-core processor1 GHz dual-core / 2.4 GHz+ multi-core
RAM2 GB / 4 GB+4 GB / 8 GB+ (16 GB+ for heavy tasks)
GraphicsIntegrated GPU / Dedicated GPU (for graphics-intensive tasks)DirectX 12-compatible GPU / Dedicated GPU for demanding applications
Network5 Mbps / 20 Mbps+5 Mbps+ / 20 Mbps+
DiskSufficient memory for RDP client software / SSD64 GB storage (minimum) / SSD highly recommended

Use the information in the table as a broad guideline. Actual requirements depend on the specific tasks performed during the RDP session.

Implement Security Measures

To enhance the security of an RDP session from Linux to Windows, implement security measures on the Windows side, Linux side, and the network. The lists below offer useful tips for each security segment.

Windows

  • Limit the number of user accounts that can establish an RDP connection.
  • Create dedicated accounts for RDP to restrict access to critical systems or data.
  • Enforce strong password policies for RDP user accounts.
  • Implement two-factor authentication (2FA) for RDP sessions.
  • Activate Network Level Authentication (NLA) to require authentication before establishing a session.
  • Temporarily lockout user accounts after multiple unsuccessful login attempts.

The network

Linux

  • Regularly update the RDP Client to the latest version to benefit from security patches and improvements.
  • Disconnect from an RDP session when it is not being used and set timeouts for idle sessions.
  • Limit the number of simultaneous active sessions.

Ideal Internet Speed for RDP Connections

RDP is efficient even over slower connections. However, specific tasks require a minimal level of visual quality and responsiveness.

The table offers an overview of minimal and recommended bandwidth for general RDP tasks:

TaskMinimum BandwidthRecommended Bandwidth
Text-based tasks1 Mbps2 - 5 Mbps
MS Office and Web browsing3 - 5 Mbps10 - 15 Mbps
Design, images, and video10 - 15 Mbps25 - 50 Mbps+
Concurrent RDP SessionsAllocate bandwidth for each concurrent session.Allocate bandwidth for each concurrent session.

Keep in mind that apart from bandwidth, server loads, network latency, and stability affect RDP performance.

Test the RDP performance under typical work conditions and adjust RDP and network settings to balance responsiveness and quality.

Reduce Resolution and Color Depth for Performance Boost

Controlling the amount of detail an RDP client transfers over the network produces significant performance gains. Read the sections below to learn how to adjust resolution and color depth in your RDP session.

Reducing the Resolution of an RDP Session

Lowering the screen resolution or window size in RDP sessions means fewer pixels are transferred over the network. This strategy improves responsiveness and speed when bandwidth is limited.

RDP clients enable users to set the screen resolution when initiating an RDP session. For instance, with FreeRDP, use the following command to set a 1280x720 resolution:

sudo xfreerdp /v:windows_machine_ip /u:username /size:1280x720

Reducing the resolution enhances speed but also compromises visual quality.

Lowering Color Depth of an RDP Session

Color depth defines how sharply a system represents or distinguishes unique colors.

Lowering the color depth reduces the amount of data transmitted for each pixel. The session is more responsive, but colors may seem off, and gradients might lose their smoothness.

In the Remmina client, the Color depth option lets users define the color depth for the RDP session.

Remmina Color depth

A low depth works for simple tasks like text editing, but the True color setting, with 32 bits per pixel, provides the high-quality visuals required for video playback or graphic design.

Conclusion

This article explained how to use an RDP client to connect to a remote Windows PC from your Ubuntu system. Use this tool to administer remote Windows systems, provide technical support to Windows users, and operate Windows-specific tools and applications.

Next, learn how to access an Ubuntu PC via Remote Desktop from Windows.

Was this article helpful?
YesNo