How to connect to a Windows PC from Ubuntu using RDP

Estimated reading: 5 minutes 382 views

The Remote Desktop Protocol (RDP) allows users to connect to another computer across a network and assume remote control over the host machine. The remote desktop connection can be established between different platforms, e.g., Linux users can RDP into a Windows system and vice versa.

System administrators working in Linux often use RDP to configure, manage, and troubleshoot Windows workstations and servers.

In this article, we will show you how to RDP to a Windows PC from your Ubuntu system.

Prerequisites

  • Server Ubuntu 22.04
  • A remote Windows machine with network connectivity.
  • Windows firewall set to allow incoming RDP connections.

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

1. Press Winkey+I to access the Settings.

2. Select System.

3. Choose Remote Desktop in the menu on the left side of the screen.

4. Toggle the Enable Remote Desktop switch On and click Confirm

Option 2: Enable RDP from Windows CMD

1. Type cmd in the Windows search box.

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

3. The reg command is used to modify the Windows Registry. Enter the following command to enable RDP:

reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

4. (Optional) 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

Install Desktop/GUI Environment on Ubuntu (Optional)

1. Update the Ubuntu packages list:

apt update

2. Enter the following command to install GNOME:

apt install ubuntu-desktop -y

3. Reboot the system:

reboot

Then open VNC in the Client area or SolusVM VPS control panel. You will see the interface and start setup

You can customize the setup as you like

After completing the setup, this is the Ubuntu desktop environment interface

Install Remote Desktop Client Software on Ubuntu

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

Option 1: Install Remmina client on Ubuntu

Remmina is the default RDP client on Ubuntu 22.04. To check if the Remmina client is installed, access the command line and enter the following command:

dpkg -l | grep remmina

1. If the Remmina client is not installed, update the Ubuntu packages list:

apt update

2. Install Remmina and the necessary plugins:

apt install remmina remmina-plugin-rdp -y

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

remmina

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

5. Enter a connection profile Name.

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

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

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

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

10. Colour depth is set to Automatic by default. 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.

The remote Windows desktop is available in the Remmina dashboard.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Option 2: Install FreeRDP client on Ubuntu

To install the FreeRDP client on Ubuntu:

1. Update the Ubuntu packages list:

apt update

2. Install the FreeRDP client using the following command:

apt install freerdp2-x11 -y

3. Establish the RDP connection using the following syntax:

xfreerdp /v:windows_machine_ip /u:username

Replace windows_machine_ip and username with valid connection details.

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

Once connected via FreeRDP, the user gains access to the remote Windows system in a graphical interface, including the Start menu, taskbar, desktop icons, and any running applications or windows.

How to Reduce Resolution & Color Depth for Performance Boost

Lowering the screen resolution or window size in RDP sessions means fewer pixels are transferred over the network. This strategy can improve 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, you can use the following command to set a 1280×720 resolution:

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

Conclusion

You have successfully used an RDP client to connect to a remote Windows PC from your Ubuntu system. Use this connection to administer remote Windows systems, provide technical support to Windows users, and operate Windows-specific tools and applications.