xRDP – Easy install xRDP on Ubuntu 18.04,20.04,22.04 (Script Version 1.4.2)

Hello World, 

We are back again with our xrdp-installer script.   Some other issues have been discovered since the release of version 1.4.1, so it time to update again the script.  Version 1.4.1 was fixing a really minor bug/issue when performing a custom installation of xRDP.  However, version 1.4.1 was also introducing another small issue.  Version 1.4.1 (and probably version 1.4) is breaking sound redirection.  

Thanks to our readers  and more specifically thanks to Hiero :), the problem was acknowledged and the root cause identified.  So, this new release of the script is including the fix and sound redirection should be working again with no need to tweak your system. 

Version 1.4 introduced the possibility (still experimental mode!!!) to perform the xrdp installation via ssh session.  The “experimental” code  was quite basic and after performing additional tests we have noticed that this code could introduce other issues and needed some improvements.  We have also acknowledge that this installation option (i.e. via ssh) seems to be used in a number of scenario, so we have decided to revisit this part of the code to improve it….The script version 1.4.2 will provide an updated version of the ssh installation method….

The new version of our famous xrdp installation script will be set to 1.4.2 (i.e. xrdp-installer-1.4.2sh).  This script replaces all previous versions.    

So, let’s proceed with this latest version…. 

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

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

Improved detection when running from ssh session    

As explained earlier,  the xrdp-intaller-1.4 version of the script was introducing a new option that would allow a user to perform the installation via an ssh connection.  However; after some more detailed tests, we have noticed that this option was not always working.  Some improvements were needed here.  Version 1.4.2 is really focusing on improving the installation process over the ssh session.   Probably, the solution is still not perfect but it’s definitely an improvement.

Add Support for more OS    

In this version of the script,  we are also introducing some additional support (i.e Best effort)  for 

  • Linux Mint (Experimental!!!)
  • Pop!Os 22.04  

Removed OS Support 

In this version of the script, we have decided to already remove  support for  some other Operating system and more specifically 

  • Ubuntu 21.10 removed (since this one will reach end of support in July 2022!!)  
  • POP!OS 20.10  
  • POP!OS 21.04 

Sound redirection not Working 

xrdp-installer-1.4.1 (and probably version 1.4) was breaking the sound redirection.  The script was basically rebuilding too much related to the Pulseaudio sound server and some service configuration file were updated wrongly.  Based on some user feedback, we have indeed noticed and confirmed that the sound redirection was not working anymore. To fix this, a user could simply issue in the Terminal console, the command 

pulseaudio --start 

and this would make the sound redirection working again within your remote session…  (but obviously this is just a workaround!!!)

After reviewing the script and the comments/findings from one of our reader (Thanks Hiero), we have indeed found that one action of the script was triggering this behavior.  We have been able to fix it quite quickly (commenting the line causing the issue 🙂 and now sound redirection should be working just fine. 

Sound redirection Support Limitations

A major change is coming in modern Operating Systems.   Pulseaudio software is being replaced by a newer version package called Pipewire. This will have an major impact also in the xRDP software a more specifically sound redirection feature.  So far, xRDP Sound redirection can work only when Pulseaudio package is installed.  This means that operating system like Pop!0S 22.04 and the coming Ubuntu 22.10,  which are ditching Pulseaudio in favor of Pipewire, will not support sound redirection anymore. 

The xRDP team has no plan (so far) about updating their code to support Pipewire solution.  Based on this new situation, the script version 1.4.2 introduces an additional check to detect if PulseAudio or PipeWire is used. Based on the software installed on the system, the xrdp sound redirection will go through if Pulseaudio.  If Pipewire is installed, sound redirection compilation will not be performed. 

How to Use the Script

The xrdp-installer-1.4.2 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.4.2.sh script will support the following Ubuntu operating system version assuming that Gnome Desktop is the default Desktop interface

  • Ubuntu 18.04.x
  • Ubuntu 20.04.x
  • Ubuntu 22.04.x
  • Debian 10 
  • Debian 11 (only if you select custom mode installation !!!) 
  • Pop!_OS  22.04 (Best Effort)

The xrdp-installer-1.4.2.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) 

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.4.2.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.4.2.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.4.2.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.4.2.sh

Note : Adjust the path where the xrdp-Installer-1.4.2.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.4.2.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.4.2.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)

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.4.2.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.4.2.sh -s      (this would enable the sound redirection) 
./xrdp-installer-1.4.2.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.4.2.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.4.2.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.4.2.sh -c -s     (this would perform a custom install and enable sound redirection)
./xrdp-installer-1.4.2.sh -c -l     (this would perform a custom install and customize xrdp login screen)
./xrdp-installer-1.4.2.sh -c -l -s  (this would perform a custom install, enable sound and customize 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.  

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.4.2.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.4.1.sh -r option) 
  • perform a new installation using your selected installation mode (standard or custom install mode) 

Final Notes

This is it for this post !   We are happy to provide an updated version of the xrdp-installer script that will improve user experience also when you perform the installation via an ssh session.  The fact that Pulseaudio is being replaced with PipeWire will affect the xrdp sound redirection and if xRDP team is not planning to update their code, we might also need to slowly remove the sound redirection switch from the script… We will see what the future brings…

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  

 

12 thoughts on “xRDP – Easy install xRDP on Ubuntu 18.04,20.04,22.04 (Script Version 1.4.2)

  1. @Ethan,

    Thank you for visiting our blog and providing feedback… Would be really cool if you can provide some feedback on this version of the script… This one has been published quite quickly and we have not tested all the combination.
    We think that all in all it should be working ok in most cases..but if more people can test it…that would be really great

    Waiting for your feedback 🙂
    Till next time
    See ya

  2. @Griffon we tested out all Operating Systems while installing over SSH. No failures. Good work.

  3. @Ethan,

    Thank you for your work and for providing feedback. We are happy to see that the script works in most case as it shoud..
    Thank you for take time to test all the scenario. REally appreciated

    Till next time
    See ya

  4. hey, i’m testing the script with sound support in ubuntu 22 and it’s not working :/

  5. Just wanted to thank you for making this, was battling xrdp and using this script enabled me to easily get a remote screen. Ubuntu 18.04.6 LTS w Microsoft Remote Desktop (mac).

  6. @Robinson,

    Thank you for visiting our blog and providing positive feedback… Happy to see that the script can be useful and that it can also work with Mac Os 🙂

    Till next time
    See ya

  7. @Arlequin,
    Thank you for visiting our blog and providing feedback. within your remote session, can you run the command pulseaudio --start. is the sound then working ? can you tell us what do you see in the sound settings pages, do you have the xrdp sink object selected

    waiting for your feedback
    Till next time
    See ya

  8. Hey, just tried out the script for the first time (custom install with sound redirect and custom login screen), and after passing the login screen, all I see if a black screen. Is this something simple I’m missing? Thanks.

  9. @Chalk,

    Thank you for visiting our blog and providing some feedback. Black screen after xRDP login screen usually means that the same user account is already locally logged on into the ubuntu machine you are trying to access. Please ensure that no one is logged on the Ubuntu machine and then try to remote into it

    Hope this help
    Till next time
    see ya

  10. @Griffon
    @Arlequin

    I have the same problem as @Arlequin … on Ubuntu 22.04

    In the Ubuntu Settings/Sound the:

    Output Device: Dummy Output
    Input Device: is blank

    brian

  11. @Bmullan;

    Thank you for the feedback… OK This is strange.. We have tested again on a VM running Ubuntu 22.04 and after rebooting the vm, sound redirection was working as expected.
    So, some questions/checks first

    Q1. if you run the pulseaudio --start, do you see the xrdp sink as input device in the settings> sound page ?
    Q2. Have you rebooted the computer after xrdp installation
    Q3. Have you done that on a clean Computer or you have uninstalled and re-install the xrdp package using the xrdp script
    Q4. Can you check the /usr/lib/systemd/user/pulseaudio.service and /usr/lib/systemd/user/pulseaudio-x11.service files and ensure that the line starting with ExecStart look like
    ExecStart=/usr/bin/pulseaudio –daemonize=no –log-target=journal
    After changing that, and restarting the computer, is this working or still empty device symptoms ?

    Q5. anything special with your setup ? can you describe your test machine (ubuntu 22.04 or other flavors – virtual/physical machine)

    Waiting for your feedback.. in the mean time, we are checking again…. the script and the sound redirection

    Till next time
    See ya

Leave a Reply