xRDP – Easy install xRDP on Ubuntu 20.04,22.04,23.XX,24.04 (Script Version 1.5.1)

   The script hereafter is outdated and has been replaced by a newer version.  Please Check the Download page for latest version. 

 

Hello World, 

A few weeks ago, we have released the latest version of our famous xrdp-installer script in order to include support for Ubuntu 24.04.  The xrdp-installer-1.5 has introduced a certain number of changes in order to take into account changes in the new xRDP release package software.  So far, the xrdp-installer-1.5 was set as a pre-release version since we were expecting some issues and behavior changes.   

In this post, we are releasing xrdp-installer version 1.5.1.   This version includes some small improvements and tackle issues, findings and comments provided by our readers.  The main discovery here is that xRDP and the Gnome remote login feature (available in Gnome 46 – shipping with Ubuntu 24.04) might create some conflicts and cause some issues when trying to reconnect to the xrdp session.  

We are still maintaining the xrdp-installer script even if Gnome Remote login feature is available and provide basic RDP support.  Gnome 47 will introduce more features in the Gnome Remote login feature.  In the mean time, our xrdp script can be used to overcome the existing limitation and can be used by people either preferring xrdp software and for people using distribution not gnome based.

so, let’s see what’s new in this release… 🙂 

Overview

By now, you should know that the xrdp-installer script aim to ease installation and post-configuration actions of xRDP on top of Ubuntu Operating system.  xRDP is a piece of software that enable remote desktop services on Linux.   This means that windows users can use their Remote desktop client (mstsc) and perform a remote connection to Ubuntu Computer.   

Initially, the script was supporting only Ubuntu with Gnome Desktop interface. However,  recent version of script tries to detect the Desktop interface in use and try to perform the post-configuration actions as required.  Recent version of the script also can run against Debian Operating system as well.  Please note that supporting other Flavors is based on a Best effort approach.

What’s new in this release (Version 1.5.1) ?

Adding Support for Zorin OS (Best effort)

Some users have been requesting to add support for Zorin OS in our xrdp-installer script.  In order to meet this request, we have decided to install and test the Zorin OS distribution.  Since the distribution is Debian based, we are expecting that no major issues would show up.   So, we have performed some basic tests with xrdp-installer and Zorin OS.  We have not performed extensive tests but the results we obtained are good. 

Based on these results, we have added support for Zorin OS in the script 1.5.1.  So, yes, version 1.5.1 of the script can run against Zorin OS !   

If you are a Zorin OS user, you can test the script and provide feedback but please note that we will provide support only on best effort model and we might not be able to provide immediate support or solution to possible issues you are encountering… 

Cleanup script code

One of our reader noticed that we were using in multiple location the same variable over and over.  So, we have decided to cleanup the code and we have now defined the Dnwload variable at the beginning of the script.  We have removed/commented the redundant instance of this variable.  
 
We have also removed the temporary fix while we were waiting for the xrdp 0.10 final release.  Since the xrdp 0.10 final release has been made available, we do not need to implement any trick to make xrdp software package working as expected. 
 

Fixing Custom Login screen Look’n feel (Quick Fix)

When we have released version 1.5 of the script, we have noticed that when using the option to customize the xRDP login screen,  the login screen was not showing a perfectly formatted image at the top of the login box.   The image was a little bit distorted.  This is because the latest release of xRDP has introduced some changes in the login screen in term of size and colors.  With xrdp-installer-1.5.1 script, we have tried to fixed this behavior.  We didn’t test this on all screen size but we think that in most scenario, this should be ok.   

Disabling Gnome Remote Login & Changing Ports  (Hiero’s Contribution)

Hiero (our number one contributor) has found out that xrdp and gnome remote login might conflict with each other and could generate some unexpected issues such as not being able to reconnect to your xRDP Session.   To avoid this situation, the script will try to check if gnome remote login functionality is present or not.  If it’s present, the script will change the ports used by the Gnome Remote login and Gnome Desktop Sharing.  More specifically, the script will set these ports values  when using the xrdp-installer script.

  • Gnome Remote login   Port : 3390 
  • Gnome Desktop Sharing Port : 3391

When you remove the xrdp package through the script using the -r switch, the default ports for Gnome Remote Login and Desktop Sharing are reset to default. 

Change download location for sound redirection compilation (Pulse Server)

Some users were complaining that when performing a custom installation and specifying sound redirection, the script would exit while trying to compile sound redirection section.  We have not been able to reproduce the issue but based on valuable feedback from some users, we know that the problem is related to some permissions issues in the /tmp folder location.  To overcome this limitation, we have decided to avoid using /tmp folder.   So, in this version of the script, all the files needed to compile pulse audio modules will be downloaded in the $Dwnload location defined at the beginning of the script. 
 
Since we were not able to reproduce the error, we would need feedback from users that have encountered such issue in the past.  If this change fix, we will confirm that this change is indeed effective.

Quick Fix for Debian when xfce/mate/cinnamon desktop selected 

Debian 12.x offers you, during the setup phase, the possibility to choice from a list of Desktop Interfaces.  If you select xfce, mate or cinnamon but no Gnome components, the DESKTOP_SESSION variable does not seem to be set correctly.  The script will run and will not issue any errors but users will not be able to login through rdp protocol.  To overcome this situation, we have added an additional check in order to detect this situation and populate accordingly the DESKTOP_SESSION variable, variable used to configure desktop interface when remotely connected.
 

Fixing rare black screen situation when using Ubuntu 24.04 and xRDP (Quick and Dirty fix)

Again, here, contribution goes to Hiero.  He detected the issue and has investigated it in order to find root cause a possible workaround.   
 
So, some users have reported that they ended up with black screen scenario while being logged only in one session (either local or remote).  So, UserA is not connected locally and he tries to remote login into the Linux machine.  The expected result should be that user can login and access the Desktop interface.  In some rare occasion,  the user will be presented with a black screen instead of the desktop interface.  The same behavior can happen when a user tries to login locally on the Ubuntu 24.04 machine. 
 
Again, this problem seems to affect exclusively Ubuntu 24.04 and xrdp package.  Next iteration and updates of Ubuntu 24.04 and xrdp might fix the issue.  In the mean time, the script will generate an additional file that will wake up the session and display the desktop interface.

Credits & Contributions 

For this release, again, Hiero has provided really useful insight and has detected some of the issues (and their possible solutions).  
Thank you Hiero  🙂

How to Use the Script

The xrdp-installer-1.5.1 script will work in a similar way as the previous versions. The following section will explain how to download, extract, set executable mode and perform the installation using the script.  The script provides some switches that can be used to customize the installation process.  

So, let’s see how this would be working…. 

Disclaimer

The script is provided AS IS.  Use it at your own risk !!! 

Prerequisites and assumptions  

The following conditions should be met in order to have the best results while using the script

  • We assume that your machine is connected to internet while performing the installation.  This is needed as additional packages and software needs to be downloaded and installed on your Ubuntu machine

Script version & Supported Ubuntu Version

The xrdp-installer-1.5.1.sh script will support the following Ubuntu operating system version assuming that Gnome Desktop is the default Desktop interface

  • Ubuntu 20.04.x
  • Ubuntu 22.04.x
  • Ubuntu 23.10.x
  • Ubuntu 24.04.x
  • Debian 10 
  • Debian 11 (only if you select custom mode installation !!!) 
  • Debian 12
  • Zorin OS 

The xrdp-installer-1.5.1.sh script can be run against the following Ubuntu flavors but we cannot guarantee that everything will work as expected (best effort)

  • Kubuntu (20.04 and later)
  • Ubuntu Budgie (20.04 and later)
  • Ubuntu Mate (20.04 and later)
  • Xubuntu (20.04 and later)
  • Lubuntu (20.04 and later)  
  • Linux Mint (Experimental at this stage)
  • LMDE (Experimental at this stage) 
  • Pop!_OS  22.04 

Note :  If you are running any of these distributions and you want to help us improving the support on those, please download and test the script.  Do no hesitate to share your findings so we can try to incorporate them in the next release 

Step 1 – Download the script

To download the script, you have multiple options.   You can from a Terminal issue the following command 

wget https://www.c-nergy.be/downloads/xRDP/xrdp-installer-1.5.1.zip

You can also simply use your browser and click on the link to download the script :  

Step 2 – unzip the file 

After downloading the zip package containing the file, you will need to unzip it first. To unzip the package, you can use the Terminal console and issue the following command 

unzip xrdp-installer-1.5.1.zip 

You can also use the GUI and the Nautilus file manager to select the downloaded package, right-click on it and select the option Extract Here

Step 2 – Set Execute Right on the script

Download the xrdp-installer-1.5.1.sh script to your system, extract content and mark it as executable . To do this, perform the following action in a terminal console

chmod +x  ~/Downloads/xrdp-installer-1.5.1.sh

Note : Adjust the path where the xrdp-Installer-1.5.1.sh script to reflect your environment

Step 2 – Run as normal user 

The script needs to be run as a normal user.  The script will start running and will prompt you for password when sudo actions are initiated.  If you run the script as root or using sudo command, the Download folder does not exist for the root user and the script fails to run as expected.   To overcome this situation, the script also check which user is executing the script. If the script is run under sudo or root accounts, a warning message will be displayed and the script will not execute

Step 3 – Switches and parameters 

The xrdp-installer-1.5.1.sh script can be executed as is (with no parameters or switches). This will perform a standard (and basic) installation of xRDP.  No sound or custom xrdp login script will be made available.  However, remote desktop, drive redirection and clipboard redirection would be available with this installation mode.  

The xrdp-installer-1.5.1.sh script accept also some additional parameters that will help customize the xrdp installation and enable additional features.  The script provides the following parameters 

--help or -h          => will display a basic help menu
--sound or -s         => will enable sound redirection 
--loginscreen or -l   => will customize the xRDP login screen 
--remove or -r        => will remove the xrdp package 
--custom or -c        => will perform a custom installation (i.e. compiled from sources)
--dev or -d           => will perform a custom installation using dev branch (unstable version)

Step 4 – Perform xRDP installation using the script 

The following sections will provide some examples and scenario on how you can use the script….. 

Standard Installation – No Parameter

As mentioned above, you can decide to use the default xrdp package available in the Ubuntu repository and perform a basic installation which will provide you remote desktop capability and will also customize the remote sesssion.  The script will ensure that the same look n’ feel will be maintained when the user logs on locally or remotely. 

To perform a standard installation, you execute the script with no parameters.  Open a Terminal console, browse to the location where the script has been downloaded and issue the following command 

 ./xrdp-installer-1.5.1.sh

When the xrdp installation package will start, you be requested to enter your password. Provide the password and proceed with the installation. Wait for completion of the script.  The machine will not reboot automatically when done so you can review the actions performed by the script….

Standard Installation with Parameters

The script can be used to perform a standard installation and still passes some parameters to get the most of the xRDP packages and their features.  For all the Ubuntu versions, we could use the following combination of parameters 

./xrdp-installer-1.5.1.sh -s      (this would enable the sound redirection) 
./xrdp-installer-1.5.1.sh -l      (this would customize the xrdp login screen -see here)

Obviously, you can combine the switches (any order) to have more features enabled  

./xrdp-installer-1.5.1.sh -s -l      (this would enable the sound redirection and customize the xrdp login screen)

Important Notes

The script can be run multiple times on the same machine.  If you have run initially the script with no parameters but you decide afterward to enable additional features, the script can be re-executed and the additional features will be enabled.  

Custom Installation – Default Installation 

Custom installation script is really flexible. Custom installation means that the script will compile the xrdp package from the source binaries. The custom installation script always uses the latest xrdp package version available 

To perform a custom installation, you will need at minimum to pass one parameter.  The following command line shows you how to perform a custom installation  

./xrdp-installer-1.5.1.sh -c     (this would perform a custom installation but will not enabled adv features like sound redirection or custom login screen)

Custom Installation – Additional Options  

If a user wants to enable additional features, you will pass some additional parameters as shown in the following examples 

./xrdp-installer-1.5.1.sh -c -s     (this would perform a custom install and enable sound redirection)
./xrdp-installer-1.5.1.sh -c -l     (this would perform a custom install and customize xrdp login screen)
./xrdp-installer-1.5.1.sh -c -l -s  (this would perform a custom install, enable sound and customize login screen)
./xrdp-installer-1.5.1.sh -c -d     (this would perform a custom install, using unstable/dev version of xrdp packages -xrdp 0.10.80)

Important Notes

The script can be run multiple times on the same machine.  If you have run initially the script with no parameters but you decide afterward to enable additional features, the script can be re-executed and the additional features will be enabled.  

Remove Installation option

This version of the script also ship with the option to remove xRDP package.  The removal option should be only used  if you have uses this version of this script to perform the installation.  To remove the xrdp package, you would simply execute the following command  

./xrdp-installer-1.5.1.sh -r     (to remove the xrdp packages)

Step 5 – Test your configuration 

After the script has run and after the reboot/shutdown and start process, it’s time to test and see if you can indeed perform a smooth remote connection to your Ubuntu machine.  Start your favorite rdp client and simply enter your credentials and start testing your installation.  If everything is ok, you will see a similar Desktop interface where Gnome Desktop is used and the Dock is visible. 

Limitations

Switch between standard and Custom install

This version of the script can be run multiple times on the same machine.  However, because of this new behavior, you cannot perform a standard installation and then decide to perform the custom installation.  Once you have selected your installation mode, you will have to stick to it.  This is kind of checked by the script.  

So, if you have performed a standard installation but afterwards you might want to use the custom installation option, the script will ignore the request.  If you want to move from standard install mode to custom mode (or vice versa), the correct process is 

  • remove xrdp (using the xrdp-installer-1.5.1.sh -r option) 
  • Reboot
  • perform a new installation using your selected installation mode (standard or custom install mode) 
  • Reboot

Known issues, Fixed Issues and limitations, New Behavior 

Known Issues 

Black Screen or disconnected immediately after connecting

As mentioned and explained multiple times,  this situation will happen (or can happen) when the same user account is used concurrently locally and remotely.  In other words,  the problem is related to the fact that the same user account is already logged in locally and a remote connection is attempted at the same time.  With xRDP software solution, a specific user account can be logged on either locally or remotely but not both….  

Ubuntu 24.04 seems to have introduced a small change when such situation would happen.  If the user is remotely logged on via xRDP software and if the same user tries to login locally, he will be presented with the following popup (see screenshot) 

Click on Picture for better Resolution

The only problem is that if you click Force Stop button, it seems not to work.  The remote session is not killed.  We have not tried this on older Ubuntu releases but I think this is because of the gnome-remote-login addition in Gnome 46.  

If a user is logged on locally and if the same user tries to perform a remote connection to the machine, the user will get informed about an existing session already running as shown in the screenshot below

Click on Picture for better Resolution

Again, here there is no way to stop the existing session.  You will need to logout locally from the session or you will need to find other ways (such as ssh or another user account) that can be used to disconnect the existing session.

Clipboard bug in xRDP 0.9.24.x and later 

It has been confirmed that there is a small bug in the xrdp clipboard feature in xrdp version 0.9.24.x and later.  In a nutshell,  when you try to copy an image from windows to your xRDP remote session in Libre Office application, nothing is inserted.   The xRDP Team is looking into this issue right now and  we have to wait for a fix that will be shipped in the next release or possibly in the dev branch version.

The problem is not related to the xrdp-installer script but we wanted to raise awareness about this issue

Final Notes

This is it for this post !   

The script version has not been tested extensively but it should work in most cases.  The script should be seen as a latest stable release version.  Please if you have time or want to help us in creating the best xRDP installer script, download the script, test it and provide constructive feedback.  If you find a bug or an issue with the script, let us know as well so we can try to fix it.   

Till next time 

See ya  

52 thoughts on “xRDP – Easy install xRDP on Ubuntu 20.04,22.04,23.XX,24.04 (Script Version 1.5.1)

  1. Hi @Griffon,
    I’ve successfully set up xrdp on Ubuntu 22.04 with NVIDIA acceleration, and everything works flawlessly. I even managed to configure sound. However, I’ve noticed an issue. When I connect via RDP (I do this from Windows), minimizing the window and then restoring it causes the screen to stop updating automatically. I can interact with the screen, but I can’t see the changes until I reconnect. Have you encountered this issue before, and do you know how to fix it? I’d greatly appreciate your help

  2. @illia,

    Sorry for the late answer… We never faced this issue/behavior because we are not using nvida solution so far.. Most of the infra is based on virtual machines and we have not need for video acceleration…
    We would need to check into this… if/when we have some time, we would like to look into nvidia xrdp implementation…..

    Till next time
    See ya

Leave a Reply