Connect Windows 11 to Ubuntu: A Guide to XRDP

The post provides a guide for setting up a Remote Desktop Protocol (RDP) session from Windows 11 to Ubuntu Linux using xrdp, an open-source RDP implementation for Linux. It instructs on installing xrdp from Ubuntu’s default repositories, configuring it including adding an xrdp user account and adjusting the startup script, and connecting to Ubuntu from…

This post shows students and new users how to set up a Remote Desktop Connection (RDP) session and connect from Windows 11 to Ubuntu Linux with xrdp.

The primary way to connect to another computer remotely in a Windows environment is via Remote Desktop Protocol (RDP). RDP is no longer restricted to only Windows environments, thanks to xrdp.

xrdp is an open-source Microsoft Remote Desktop Connection (RDP) implementation on Linux systems, including Ubuntu desktops. It provides graphical login to remote systems using RDP protocols.

xrdp also enables two-way clipboard transfer and audio, drives redirection, and accepts connections from various RDP clients: FreeRDP, desktop, NeutrinoRDP, and Microsoft Remote Desktop Client.

For students and new users running Ubuntu desktops and wanting to connect via RDP, xrdp is the app in this case.

For more about xrdp, please visit its homepage.

To get started with installing and configuring xrdp on Ubuntu, follow the steps below:

How to install xrdp on Ubuntu

xrdp works on desktop systems. You won’t be able to connect to systems without a desktop environment. On Ubuntu servers, you must install a desktop environment before using xrdp.

xrdp is available in Ubuntu default repositories—no need to add additional repositories to install. Run the commands below from the terminal to install it.

sudo apt update
sudo apt install xrdp

After installing, run the commands below to verify that it is installed and running.

sudo systemctl status xrdp

You should see a similar result as shown below:

 xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2021-06-13 09:43:03 CDT; 1min 53s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
   Main PID: 37933 (xrdp)
      Tasks: 1 (limit: 4653)
     Memory: 1.1M
     CGroup: /system.slice/xrdp.service
             └─37933 /usr/sbin/xrdp

Jun 13 09:43:02 ubuntu2004 xrdp[37932]: (37932)(139757869672256)[INFO ] address [0.0.0.0] port>
Jun 13 09:43:02 ubuntu2004 xrdp[37932]: (37932)(139757869672256)[INFO ] listening to port 3389>

How to configure xrdp on Ubuntu

Now that you have XRDP installed on Ubuntu, configure it to make connections without facing numerical issues.

First, add an xrdp user account to the SSL-cert certificate key file groups. By default, xrdp uses the /etc/ssl/private/ssl-cert-snakeoil.key file, which is readable only by users of the “ssl-cert” group.

The SSL-cert key file is essential when connecting via a remote desktop on Ubuntu.

sudo adduser xrdp ssl-cert 

Output:

Adding user xrdp' to groupssl-cert' …
Adding user xrdp to group ssl-cert
Done.

Next, add these lines into the xrdp startup script to help resolve some situations where users’ screens have black backgrounds.

Open the startup script file.

sudo nano /etc/xrdp/startwm.sh 

Then, add these lines to the end file and save.

Unset DBUS_SESSION_ADDRESS
Unset XDG_RUNTIME_DIR

Save the file and exit.

Restart the xrdp service.

sudo systemctl restart xrdp 

Make sure the firewall isn’t enabled and blocking port 3389.

sudo ufw allow from 10.0.2.0/24 to any port 3389
sudo ufw reload  

Replace the highlighted subnet with your own.

Log out of Ubuntu. Ensure you’re not already logged in to Ubuntu while attempting to connect via Remote Desktop Connection. You can’t be logged in to Ubuntu while you connect via RDP.

How to connect to Ubuntu from Windows 11

Now, try connecting to Ubuntu via Remote Desktop Protocol (RDP).

When prompted to accept the certificate, click Yes.

Type in your username and password for the Ubuntu system.

That’s it!

Conclusion:

  • Setting up a Remote Desktop Connection from Windows 11 to Ubuntu using xrdp is straightforward.
  • Ensure both systems are correctly configured and set the necessary firewall rules.
  • xrdp provides an effective way to remotely access and control Ubuntu desktops with support for various RDP clients.
  • With xrdp, you can enjoy features like clipboard sharing and audio redirection, enhancing the remote access experience.
  • Following the steps outlined in this guide will help you establish a successful remote connection, enabling efficient work and collaboration across different platforms.

Comments

  1. Followed the same steps but I get an error.

    connecting to sesman ip 127.0.0.1 port 3350 sesman connect ok sending login info to session manager please wait login successful for display 10 started connecting connection problem giving up some problem

    1. Hello! I’ve encountered the same error as well. I’ve tried all ways and means, but it is still not connecting. Please help. Thank you

  2. Hi,
    I followed the exact instruction but getting the following error:

    connecting to sesman ip 127.0.0.1 port 3350
    sesman connect ok
    sending login info to session manager, please wait…
    xrdp_mmprocess_login_response:login failed

  3. Is there a way to access Linux from Windows 10, but without logging out from Ubuntu?

  4. I have followed the steps once while i was logged in Ubuntu through Powershell and then with closed. In both cases it doesn’t open GUI Desktop and xorg window just closes no error.

  5. This was very helpful and worked perfectly. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *