How to Use Windows Remote Desktop to Connect to Ubuntu

How to Use Windows Remote Desktop to Connect to Ubuntu? A Step-by-Step Guide

To use Windows Remote Desktop to connect to Ubuntu, you first need to enable a Remote Desktop Protocol (RDP) server on your Ubuntu machine, such as xrdp, since Ubuntu does not support RDP natively. After installing and configuring xrdp on Ubuntu, you can open the Remote Desktop Connection app on your Windows PC, enter the Ubuntu system’s IP address, and log in with your Ubuntu username and password. This allows you to access Ubuntu’s desktop environment from Windows just like you would with another Windows system.

Why Use Remote Desktop to Connect to Ubuntu?

Before we dive into the how-to, let’s briefly discuss why you might want to use RDP to connect from Windows to Ubuntu:

  1. Cross-platform compatibility: As Ubuntu is a Linux distribution and Windows is the most widely used desktop OS, many users need to switch between these two platforms seamlessly.
  2. Easy file sharing: With RDP, you can easily transfer files between your local Windows machine and the remote Ubuntu system.
  3. Graphical interface: Unlike command-line-based connections like SSH, RDP allows you to interact with the remote Ubuntu desktop just as if you were sitting in front of it.
  4. Centralized management: For administrators managing multiple systems, using a single Windows machine to manage both Windows and Ubuntu systems can be time-saving.

Step 1: Prepare Ubuntu for Remote Desktop Connection

To enable remote desktop access on Ubuntu, you’ll need to install and configure a remote desktop server. Ubuntu doesn’t have native support for RDP, so you’ll need to use a third-party solution. One of the most popular tools for this is xrdp, which enables RDP connections to Linux systems.

Install XRDP on Ubuntu

  1. Open the terminal on your Ubuntu machine. You can do this by pressing Ctrl + Alt + T or searching for “Terminal” in the applications menu.
  2. Update the package list to ensure you have the latest repository information:
    bash   Copy code
    sudo apt update
  3. Install the xrdp package:
    bash   Copy code
    sudo apt install xrdp -y
  4. After the installation is complete, start the xrdp service and enable it to run at boot:
    bash   Copy code
    sudo systemctl enable xrdp
    sudo systemctl start xrdp
  5. Check the status of the xrdp service to ensure it is running properly:
    bash   Copy code
    sudo systemctl status xrdp

At this point, xrdp should be running, and your Ubuntu machine is ready to accept remote desktop connections.

Configure XRDP for Enhanced Performance

  • Firewall: If you have a firewall running on Ubuntu, you need to allow the RDP port (3389 by default) through the firewall. Use the following order to open the port:
    bash   Copy code
    sudo ufw allow 3389/tcp
  • Desktop Environment: Ubuntu ships with the GNOME desktop environment by default, which may not work perfectly with xrdp. For better compatibility, you can switch to a lightweight desktop environment like Xfce.

To install Xfce:

bash   Copy code
sudo apt install xfce4 xfce4-goodies -y

Once installed, configure xrdp to use Xfce:

  1. Open the xrdp configuration file:
    bash   Copy code
    sudo nano /etc/xrdp/startwm.sh
  2. Add the following line before the exit 0 line at the bottom of the file:
    bash   Copy code
    startxfce4
  3. Save the file and exit the editor (Ctrl + X, then Y to confirm changes).
  4. Restart the xrdp service:
    bash   Copy code
    sudo systemctl restart xrdp
    

Step 2: Configure Windows for Remote Desktop Access

Once the Ubuntu machine is configured to accept RDP connections, you’ll need to set up your Windows PC to connect to the Ubuntu system. Windows comes with a built-in Remote Desktop Client, so there’s no need to install additional software.

Open Remote Desktop Connection on Windows

  1. On your Windows PC, press Win + R to open the Run dialog box.
  2. Type mstsc and press Enter. This will open the Remote Desktop Protocol Connection window.

Alternatively, you can search for “Remote Desktop Connection” from the Start menu.

Enter the IP Address

To connect to your Ubuntu machine, you need its IP address:

  1. Find the IP address of your Ubuntu machine by typing the following in the terminal:
    bash   Copy code
    hostname -I
  2. Enter this IP address in the “Computer” field of the Remote Desktop Connection window on your Windows PC.

Configure Connection Settings

  1. Username and Password: When prompted, enter the username and password of the Ubuntu account you want to access. Make sure the account has a desktop environment configured, as the RDP protocol will give you access to a graphical session.
  2. Display Settings: You can click on “Show Options” to configure advanced settings, such as display resolution and session recording options.
  3. Connection: Once everything is set, click “Connect.” You will see the login screen of your Ubuntu machine, and after entering your credentials, you will gain access to your Ubuntu desktop.

Step 3: Fine-tuning the Remote Desktop Experience

File Transfer
One of the advantages of using RDP is the ability to transfer files between the local Windows machine and the remote Ubuntu desktop. To enable this:

  1. Before connecting, click “Show Options” in the Remote Desktop protocol Connection window.
  2. Go to the Local Resources tab.
  3. Under Local devices and resources, click on More.
  4. Check the box for Drives to share your local drives with the remote Ubuntu machine. You can then copy files back and forth easily.

Printer and Clipboard Sharing

RDP also supports clipboard sharing (copy/paste) and printer redirection. These can be enabled in the Local Resources tab:

  • Clipboard: Ensure that the Clipboard checkbox is checked to allow copy-pasting between the systems.
  • Printers: If you want to use your local printer on the remote Ubuntu machine, check the Printers box.

Learn More: How to Enable Remote Desktop Protocol Using XRDP on Ubuntu

Step 4: Security Considerations

SSH Tunnel for RDP
While xrdp is secure, adding an extra layer of security by using an SSH tunnel can prevent unauthorized access. This is particularly useful if you are connecting over the internet, not just within a local network.

To create an SSH tunnel on your Windows PC:

  1. Install PuTTY or another SSH client.
  2. In PuTTY, go to the Tunnels section.
  3. Enter 3389 as the source port and localhost:3389 as the destination.
  4. Start the SSH session and connect to your Ubuntu machine over RDP using localhost as the IP address.

Use a Strong Password

Ensure that the user accounts on the Ubuntu machine have strong passwords to prevent brute-force attacks.

Conclusion

Using Windows Remote Desktop to connect to an Ubuntu system is a straightforward process that can improve productivity, especially if you work across multiple platforms. By installing and configuring xrdp on Ubuntu, you can remotely access a full graphical desktop environment from any Windows machine. Whether you’re an IT administrator, developer, or casual user, this setup will help you efficiently manage your Ubuntu system from a distance.

With additional security measures like SSH tunneling and file-sharing capabilities, RDP offers a versatile solution for remote Ubuntu access. Happy remote working!

Scroll to Top