xRDP – Easy install xRDP on Ubuntu 18.04,20.04,21.10,22.04 (Script Version 1.4.1) – Bug Fixing

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

Hello World, 

In our previous post, we have notified you that some issues have been detected in the script version 1.4.  The detected issue looks really minor and in order to tackle this issue, we have decided to release an updated version in order to fix the small bug/issue detected.   The new version of our famous xrdp installation script will be set to 1.4.1 (i.e. xrdp-installer-1.4.sh).  This script replaces all previous versions.   

Please note that most of the tests have been done on Ubuntu 22.04 with Gnome Desktop Interface and Debian 11.  

Please also note that this update only tackle the detected issue when installing against Ubuntu 20.04.  Version 1.4.2 is being worked out as well to tackle the necessary improvement for the scenario where installation is performed via ssh session….Version 1.4.2 will be released at a later stage (probably a few weeks from here)

So, let’s go ! 

Overview

The xrdp-installer-1.4.1.sh script ease the installation and post-configuration actions of xRDP on top of Ubuntu Operating System but also against Debian Distribution.  This release is really a minor update and aim to fix a small issue that has been detected by multiple users 

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

Fixing the issue “Custom install fails on Ubuntu 20.04”   

As explained in our previous post,  the xrdp-installer-1.4 running the custom installation mode fails.  After reproducing the error, we have been able to detect the issue and provide a quick fix for it.  This fix has been actually provided by multiple users that have encountered the issue.  Thank you to them for sharing their findings  🙂 

Change background color of the xrdp login screen   

Since the color scheme has change in Ubuntu 22.04,  we have decided to update the background color used in the xrdp login screen.  Previous versions of the script was using the purple color scheme. This version of the script will set the background color to grey to match the current color scheme used by Ubuntu 22.04 

How to Use the Script

The xrdp-installer-1.4.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.4.1.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 21.10.x
  • Ubuntu 22.04.x
  • Debian 10 
  • Debian 11 (only if you select custom mode installation !!!) 
  • Pop!_OS (Best Effort)

The xrdp-installer-1.4.1sh 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)   

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.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.4.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.4.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.4.1.sh

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

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

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.     As a reminder, the code to perform the installation via ssh session is being re-worked and a new version of the script will be release soon providing better ssh support  

 

Till next time

See ya

 

28 thoughts on “xRDP – Easy install xRDP on Ubuntu 18.04,20.04,21.10,22.04 (Script Version 1.4.1) – Bug Fixing

  1. @Lib Eco,

    Thank you for visiting our blog and providing feedback… can you provide more information and possibly screenshots… How did you perform the installation, via ssh, via gui, using custom mode, or standard mode… Can you provide us a screenshot of the error/issue detected,… possibly any logs that might be useful… so we can investigate and update the script

    waiting for your feedback
    Thank you
    Till next time
    See ya

  2. Thanks very much for this, just upgraded my VM from Ubuntu 20.04 to 22.04.

    Would be great if there was a way to pass a camera over xrdp-sink.

  3. Just a big thank you for your work. This script has saved me so much time over the years.

  4. @Geoff;

    Thank you for visiting our blog and provide valuable feedback. Happy to see that the script is working as it should (even if we still need to refine some parts)… Passing through Camera would be cool indeed but this is really up to the team behind xRDP solution : )

    Till next time
    See ya

  5. @Gijs,

    Thank you for visiting our blog and providing positive feedback. Really happy to see that our little script can be useful and can be used quite easily…. Thanks

    Till next time
    See ya

  6. @Virain,

    Thank you for visiting our blog and providing feedback. Black screen usually means that the same user account is already logged in locally on the Ubuntu machine. If the same user tries to access the machine remotely, he will see a black screen indeed (see this post : http://c-nergy.be/blog/?p=16682. If this is not your issue, we might need to have a look at the logs (/var/log/xrdp-sesman.log and /var/log/xrdp.log) to see what could be wrong. We have tested the script against a brand new ubuntu 18.04 and seems to work fine.. we had access to the desktop via RDP

    Till next time
    See ya

  7. I used script v1.4.1 on ubuntu 22.04 (with -s -c options).
    Audio wasn’t working. I discovered that pipewire and pipewire-pulse is installed by default on Ubuntu 22.04.

  8. On some Ubuntu 20.04 systems which do not install Ubuntu-Desktop, you need to install it with :
    sudo tasksel install ubuntu-desktop

    Then, set your system boots into the graphical target :
    systemctl set-default graphical.target

    To fix black screen problem, you can add below 2 lines before test -x /etc/X11/Xsession && exec /etc/X11/Xsession in /etc/xrdp/startwm.sh:
    unset DBUS_SESSION_BUS_ADDRESS
    unset XDG_RUNTIME_DIR

  9. Please fix the issue with custom installs. I can see it works in 2204, however the script does not work in custom mode in 20.04 now. I had normal xrpd install (which is hopelessly outdated) and had removed it with apt remove xrdp –purge. Also iirc if you do have residual config then the installer script is not building anything at all in custom mode, you need to wipe it always.

    Also I understand it is not supported, but neither of the versions I tried in the past (i think from 1.2 to 1.4.1 inclusive) works in custom mode in Debian12.

  10. follow up: I had saved a log of the script install in a paste.

    However the problem is that your wordpress install flags posts as spam even with concealed links

    lets try again this way: so the terminal output is
    p/UTNMm
    paste estonia 😀

  11. @Brad,

    Thank you for visiting our blog and providing feedback.

    To answer your comment, indeed, in order to use xRDP software you will need to have a Desktop Environment installed on top of your Ubuntu Server. xRDP provide a way to perform remote desktop so you need to have a desktop installed

    About the black screen, we have described how to bypass this limitation (see this post – xRDP – Allow multiple sessions (local and remote) for the same user – HowTo). However,
    we do not recommend using this approach because of possible side effects that might cause more issues than providing benefit. This is up to each user to test and see what this trick provide as added value…

    Till next time
    See ya

  12. @Brian,

    Thank you for the feedback. From what we know, Ubuntu 22.04 is running partially pipewire to support Wayland and RTC protocol in Browser. However, PulseAudio is still installed and the default Sound Server. If you run Pulseaudio --version You will see that the software is indeed installed.

    #————————-UPDATE INFO # 1 ——————————–#

    After checking against a up to date Ubuntu 22.04, indeed it seems that sound redirection is not working anymore even if we are using the script provided by the xRDP Team….We will need to check that and see if anything has changed in the xRDP Repo that would prevent the sound redirection…

    Need to further investigate

    #————————-UPDATE INFO # 2 (Workaround) ——————————–#

    After playing Around with xrdp and sound redirection, we have done the following to make it work again……(this is at this stage a workaround)

    reboot the machine
    login via xRDP to the machine
    open Terminal Console
    issue command
    pulseaudio

    The Terminal Console needs to be running all the time.. You should see that the sound icon is back and pointing to xrdp sink “device” in sound settings control panel
    Give it a try and provide feedback… This is again something with xRDP code….

    Thank you for your hep and support and all the positive feedback you are providing

    Till next time
    See ya

  13. @Alex,

    thank you for your feedback but we do not see any log files….. can you copy these log into pastebin web site so we can review them….
    Please read also my other comments since we are checking the script against Ubuntu 20.04

    Till next time
    see ya

  14. @Alex;

    We have re-tested again the script 1.4.1 against Ubuntu 20.04.4 (with latest updates) and the script does not through any errors and we are able to perform remote connection to Ubuntu…
    So not sure what’s your problem…. If you need to move from Standard install to custom installation, you have indeed to use the script with the -r switch to remove the xRDP software, Reboot the machine and then perform a custom installation…

    About Debian, the script has been tested up to Debian 11.2 and as far as we know Debian 12 is still not a stable version… Again, rested against Debian, we do not seen any errors while running the script….

    We need to see your logs to see if we can identify your issue.
    Moreover, you do not really explain what’s not working… are you accessing the xRDP login page or not ? Can you check that xrdp services are up and running….
    How did you performed the installation, from a Desktop Interface or via SSH…. If it’s via SSH, yes, we still need to tweak this part and a new version of the script is being working out….

    waiting for your feedback

    Till next time

  15. @ Griffon:

    again flagged 🙁
    your plugin is way too aggressive. How can I post anything to provide logs etc? The log was provided above, but I had to obfuscate it pretty well to get thru.

  16. @Alex,

    Please use Pastebin service to copy the content of your logs…. if this is still not working, I can send you an email address where you can send the logs

    Do not forget to provide some info about your machine and how you performed the installation and what’s not working… at which stage…

    Hope this help
    Till next time
    See ya

  17. Just FYI — it took like 5 attempts to post a comment above before i could get htru, and thats removing half the data which I put there initially. This wp plugin is *insanely* annoying.
    Can you provide a more convenient way to send data? like github or something even would do

  18. Griffon,

    Regarding pulseaudio issue, the cause is as follows.
    I checked /usr/lib/systemd/user/pulseaudio.service and /usr/lib/systemd/user/pulseaudio-x11.service
    After ./xrdp-installer-1.4.1.sh -s, value of ExecStart was following line.
    ExecStart=/tmp/pulseaudio-15.99.1+dfsg1/bin/pulseaudio –daemonize=no –log-target=journal
    This line should be:
    ExecStart=/usr/bin/pulseaudio –daemonize=no –log-target=journal
    They are overwritten by line 752: “sudo ninja -C build install”.
    The reverted ExecStart restores pulseaudio.

    In order to build pulseaudio-module-xrdp, it is not necessary to build and install pulseaudio.
    Therefor, It is OK to remove line 752.
    line 751: “sudo meson –prefix=$PulsePath build” is enough to build pulseaudio-module-xrdp.

  19. Hello,
    I forgot to write how to recover overwritten files.
    The easiest way is to reinstall pulseaudio and logout/login.
    $ sudo apt reinstall pulseaudio
    After that sound should revives for both local and XRDP login.

  20. @Hiero;

    Thank you for the information… We will need to perform some additional tests… and we will update the script accordingly… In some cases, we do not need to perform all these steps against ubuntu 22.04 and sound is working as expected… We are looking at what could be the differences. But your findings are definitely useful and we will tackle them as required

    Thank again
    Till next time
    See ya

    Till next time
    See ya

  21. @Hiero,

    Thank you for your findings… We can confirm that indeed there is a problem with the script ver 1.4.1 for sound redirection. We had different results because we were using different script version :p
    Based on your findings, we will update the script version to 1.4.2 which will be released in a few days…(probably next week…. )

    Thank you for your help and your findings…this is really helping us since we have not much time lately to work on this…but you see we are trying to keep up

    Till next time
    See ya

  22. @griffon

    Thank you for providing this script. It used to work great for me when I was running Ubuntu 18.04. However, since I updated, I cannot type anything (keyboard not working) once I get to the login screen. Have you heard of this issue before?
    I am trying to connect from one computer with Ubuntu 22.04 to another computer, where the xrdp server is running and I use remmina.

  23. @Flurin,
    Thank you for visiting our blog and providing feedback… Sorry for the delay in our response we have been quite busy…
    So, first question that we will have… have you used the latest version of the script which is 1.4.6 and which can be downloaded at https://www.c-nergy.be/products.html (free download)
    Then when you say login screen – is it the Ubuntu login screen or xRDP login screen… I would guess Ubuntu login screen
    So, my guess here is that some x11 packages might have been removed… Possibly, can you access to your Ubuntu via console (command line instead of the GUI)… can you use your keyboard ?
    If yes; try to login and try to re-install broken packages… In the past, this kind of issue existed and to fix it, we had to run a command similar to

    sudo apt-get install xserver-xorg-input-all

    This might not fix your issue but you can give it a try… With the latest version of the script, we didn’t really heard about this specific issue…but again this might solve your issue…

    Waiting for your feedback
    Hope this help
    Till next time
    See ya

Leave a Reply