xRDP – Easy install xRDP on Ubuntu 18.04,20.04,22.04,22.10, 23.04 (Script Version 1.4.7)

Hello World, 

Ubuntu 23.04 has been released a few weeks ago and it’s time to update the xrdp-installer script to support the latest version of Ubuntu 23.04.  Ubuntu 23.04 has suffered from multiple issues and the final release version still seems to be affected by a problem or bug. (see Ubuntu – Cannot Install Ubuntu 23.04 Daily Build – Possible Bug and Ubuntu – Ubuntu 23.04 has been released but still problems with Virtual machines)

Today, we are releasing the version 1.4.7 of the xrdp-installer script.  This is more a maintenance release which not many changes in it.  This release will include mainly Ubuntu 23.04 Support.  So, time to deep dive into 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.4.7) ?

Adding Support to Ubuntu 23.04   

As requested by our readers, we have updated the script in order to support the latest version of Ubuntu (i.e. 23.04).  

Adding compilation parameters

Some users have noticed that the Hyper-V enhanced mode was not working as expected when performing a custom installation.  The functionality is working fine when you are performing a standard installation.  So, after a quick look, we have noticed that we would need to add the –enable-vsock option when compiling the xrdp from source.  This feature has been added as well in this release.

What’s missing in this release (Version 1.4.7)  ? 

Sound redirection (if using Pipewire) 

The xrdp package expect the pulseaudio sound server in order to enable sound redirection.  Since Ubuntu 22.10 and later are using now Pipewire sound server, the xrdp-installer script will notify you that no Pulseaudio server has been detected and that no sound redirection will be available.  In a previous post, we have described a procedure how to make sound redirection working when using Pipewire (see  xRDP – Testing Initial Pipewire Sound Rediretion Support in Ubuntu 22.10 (Early Stage)). If you are using Pipewire and you need sound redirection, you can try to use this procedure.    

The next release will include (still as testing mode) the support for Pipewire.  This means that the script will try to compile the test module that has been written by Hiero and will try to enable sound redirection as required.

How to Use the Script

The xrdp-installer-1.4.7 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.7.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
  • Ubuntu 22.10.x
  • Ubuntu 23.04.x
  • Debian 10 
  • Debian 11 (only if you select custom mode installation !!!) 

The xrdp-installer-1.4.7.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) 
  • 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.4.7.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.7.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.7.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.7.sh

Note : Adjust the path where the xrdp-Installer-1.4.7.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.7.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.7.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.7.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.7.sh -s      (this would enable the sound redirection) 
./xrdp-installer-1.4.7.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.7.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.7.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.7.sh -c -s     (this would perform a custom install and enable sound redirection)
./xrdp-installer-1.4.7.sh -c -l     (this would perform a custom install and customize xrdp login screen)
./xrdp-installer-1.4.7.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.7.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.7.sh -r option) 
  • perform a new installation using your selected installation mode (standard or custom install mode) 

Known issues, Fixed Issues and limitations 

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….  

In the past, we have provided some workarounds that could be used to allow multiple connections for the same user.  However, in Ubuntu 22.04, we have encountered some additional issues and again we strongly recommend not using these workarounds…..

Some workarounds (provided as is) to try to fix the issues are available. We do not recommend to use them ! Use at your own risk !!!

Final Notes

This is it for this post !   

The script version has not been tested extensively because of Ubuntu 23.04 issues.  The script should be seen as a maintenance release in order to maintain usability.  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.   

We are already working on the next version where more changes will be introduced…. 

 

Till next time 

See ya  

35 thoughts on “xRDP – Easy install xRDP on Ubuntu 18.04,20.04,22.04,22.10, 23.04 (Script Version 1.4.7)

  1. Thanks @Griffon! I’ve been using your script for years. Much appreciated!

  2. @Ben,

    Thank you for visiting our blog and providing feedback. Happy to see that the script is useful and used out there 🙂
    till next time
    See ya

  3. @Griffon thanks a lot for the cool script!
    Tell me please. Is it possible to adapt the launch of this script in ansible playbook? I tried to run this script through the shell module, but the playbook execution hung after that.

  4. @George,

    Sorry for the late answer…was travelling…. Yes, it’s always best to remove the old version and re-run the script..

    Till next time
    See ya

  5. @Denis,

    It would be possible (I would guess) to adapt the script so you can run it with ansible…IT would be also possible to create a dedicated playbook to install and configure xrdp…
    This could be an interesting exercise but we are really busy at the moment…. So it will take some time for us before we can come up with a final answer

    Till next time
    See ya

  6. This script does work on Debian 12 🙂
    I was having trouble with is because the container that I upgraded from in Proxmox did not have deb-src entries in the /etc/apt/sources.list. After I duplicated all the deb entries with the deb-src entries, the script works with sound!

  7. @Benjamin,

    Thank you for the feedback and sharing your findings…. Cool that the script still work on Debian 12…. We are beginning to work on a small update to be provided in a few weeks… We will try to include Debian 12 in our testings

    Till next time
    See ya

  8. Hello there!

    For some reason I can’t understand after “./xrdp-installer-1.4.7.sh -s” or “./xrdp-installer-1.4.7.sh -c -s” execution Remmina or KDE remote desktop can’t be loaded. This works for Kubuntu 22.04.02, Debian 11.7, Debian 12. Unfortunatelly my Linux skills aren’t good enough to find the problem. Can you please help me with this issue?

    Kind regards,
    Kirill

  9. @Kirill,
    Thank you for visiting our blog and providing some feedback. Your question is not clear to us…. What’s working and what’s not working ? Can you provide the Linux Distribution you are using when using the xRDP script. Then can you tell us what you are trying to do ? using Remmina to connect to the xRDP server or within the XRDP session, you cannot launch remmina or kde remote desktop

    waiting for your feedback
    Till next time
    See ya

  10. Cool script, didn’t tried it yet, but seems cool.
    Could you tell how to setup sound on alrady installed xrdp?

  11. @Dimitry,

    Thank you for visiting our blog. So, if you have already installed xrdp, it would be best to remove xrdp and perform the installation with the script (using the different parameters option provided)
    However, If you have already xrdp installed and want to keep it like this, you could probably run the script using the -s switch (./xrdp-installer-1.4.7.sh -s) to just install the sound. The script will try to install xrdp as well but if already installed will not change your system (if you have used the xrdp pacakge from ubuntu repository). Again, we never test this…so perform this at your OWN RISK

    Finally, you could also try the following approach (see post https://c-nergy.be/blog/?p=17734)… which explain how to build from source

    Hope this help
    Till next time
    See ya

  12. Used your script on Ubuntu 18.04 & I see only blank screen with cursor. rebooted machine multiple times.

  13. @Anil,

    Thank you for visiting our blog and providing feedback. Usually, black screen happens because you are logged in locally on the machine and you are trying to perform remote session. with xRDP, a user can access either the local session or the remote session but not both at the same time. This is by design in xRDP software.

    Hope this help
    Till next time
    See ya

  14. @Griffon,

    After reboot machine is not logged in locally.
    Accessing the machine via SSH is considered as logged in locally ?

    I tried to override the about condition, rebooted & tried only RDP at first, after sign-in stilll I see blank screen & sometimes it connects & disconnects immediately.
    During login session, I see various session options “xorg, x11rdp, xvnc, console, vnc-any, sesman-any, neutrinordp-any”, I tried all session options but still cant connect.
    Created new user to check, but still same result.

    Please let me know if you need any logs for validating & if yes, how to share ?

  15. @Anil;

    Please provide which version of Ubuntu you are running (flavour + release number)
    Which desktop interface are you using (Gnome, KDE,…)
    How did you perform the installation ? Via the script, clean installation, which switches, any error during the execution of the script ?
    in the xrdp login screen, you have to select xorg option
    Check your Log files at /var/log/xrdp.log and /var/log/xrdp-sesman.log for possible hint to troubleshoot the error
    Check also if ~/.xsessionrc file is created and populate accordingly

    Till next time
    See ya

  16. I have issues with the script version 1.4.7 in Debian 12. Fresh install with GNOME, add user to sudo group, download and run script with -c -l -s. I had to go into Downloads/xrdp and also Downloads xorgxrdp and run make install in both then re-run the script.

    For some reason the checkinstall is not copying files. Hope this is useful to someone for debugging.

  17. @Griffon,

    Ubuntu 18.0.4.6

    During script execution, gnome was not installed automatically. I had to manually install the Gnome, later in “/etc/xrdp/startwm.sh” it was showing below & I modified to add GNOME, post reboot, I was able to use Gnome desktop.
    Before:
    export GNOME_SHELL_SESSION_MODE=
    export XDG_CURRENT_DESKTOP=
    After:
    export GNOME_SHELL_SESSION_MODE=ubuntu
    export XDG_CURRENT_DESKTOP=ubuntu:GNOME

  18. What would your recommended fix be for stuttering in the audio when doing sound redirection? I am on a wired 2.5Gb/s ethernet network and the video is pretty much flawless, but not the audio.

  19. @Andrew,

    The script has not been tested against debian 12 yet. Some users reported already some issues and provided some tweaks… We will need to look into this but not before september since we are busy with an heavy project

    Till next time
    See ya

  20. @Anil,

    The script is not supposed to install any Desktop environment. Please ready carefully the instructions… The required operating system are Ubuntu Desktop which ship with Gnome Interface. if you want to use Ubuntu SErver, you will need to install your favourite Desktop Interface

    Till next time
    See ya

  21. Is there a way to remove the need for a reboot? The reason is that I will be running in a controlled environment where everything needs to be baked into a Docker image. Runtimes are ephemeral (reset to the original image on reboot). Running it as root would also be a plus, though I think I can get around this.

  22. @Mauricio,
    Thank you for visiting our blog and providing some feedback. The reboot is not a strong requirement. The remote desktop functionality should be working even without the reboot. The reboot was needed mainly when enabling sound redirection. The modules were not always loading properly. Give it a try without reboot and check…

    Hope this help
    Till next time
    See ya

  23. @Yorai,

    Thank you for visiting our blog. We are not using social networks and not planning to. Visit our blog on a regular base and you see the new versions of the script showing up… we tend to release script following the Ubuntu release cycle

    Till next time
    See ya

  24. @M,

    Thank you for visiting our blog and sharing your experience.
    Since you do not provide any information about your issue… we cannot really provide some advice.
    Moreover, in the script and in the post, there is a clear disclaimer. Use this at your own risk.
    We cannot guarantee that the script will work in all situations.

    See ya

  25. Hello,

    I am running Ubuntu 22.04 Server edition. I installed MATE via “tasksel”, rebooted the server and ran the script, rebooted again.
    However, when I tested xRDP from my Mac with Microsoft Remote Desktop I had an error message with ” OOOps something went wrong” with a sad face. As far as I can tell all the services were running as well as the display manager. . I uninstall MATE and remove xRDP with “-r” option of the script. I re-installed MATE + ran script + reboot. But I got the same error message.

    I finally uninstalled everything again. This time I installed Ubuntu-Desktop with “apt install ubuntu-desktop” ran the script + reboot. Everything seems to be working just fine. The only thing is the server GUI is a bit slow. It takes 3 to 4 seconds to open a directory or a new window. In the setting of the Microsoft Remote Desktop i changed the color quality from 32 bit to 16 bit. that helps just a little bit but it is still slow.
    I used Microsoft Remote Desktop for all my servers with a GUI (MATE) . Ubuntu 16.04, 18.04, 20.04 and I never any error issues nor slow GUI issue.

    Can you tell me why MATE did not work ? and why is the Ubuntu-Desktop is kind of slow?

    I know that MATE is a much lighter desktop environment. The server is a AMD dual socket with 48 core and 256GB RAM.

    Thank you.

  26. I’m using Ubuntu-22.04.3 with Gnome 42.9 on wsl2. Used the script with -c -l -s flags. Trying to connect using Microsoft’s Remote Desktop Connection App.
    I tried localhost:3389 and 172.20.#.# (got this by running ifconfig | grep inet) to connect to my ubuntu installation.
    When I tried with localhost:3389, it says I already have a console session in progress and can’t connect to another (not verbatim).
    When I tried with 172.20.#.#, I get certificate error(server name incorrect), which I ignore and connect anyway, then I put my credentials in the custom screen (-l) and the screen is grey and stuck, and after a while connection log pops up. logs are below:

    *******************************************logs from service xrdp status: ******************************************
    Sep 14 20:30:44 Brother-Eye xrdp[1030]: [WARN ] local keymap file for 0x00000409 found and doesn’t match built in keymap, using local keymap file
    Sep 14 20:31:04 Brother-Eye xrdp[1030]: [INFO ] connecting to sesman on 127.0.0.1:3350
    Sep 14 20:31:04 Brother-Eye xrdp[1030]: [INFO ] xrdp_wm_log_msg: sesman connect ok
    Sep 14 20:31:04 Brother-Eye xrdp[1030]: [INFO ] sesman connect ok
    Sep 14 20:31:04 Brother-Eye xrdp[1030]: [INFO ] sending login info to session manager. Please wait…
    Sep 14 20:31:05 Brother-Eye xrdp[1030]: [INFO ] xrdp_wm_log_msg: login successful for user araf on display 10
    Sep 14 20:31:05 Brother-Eye xrdp[1030]: [INFO ] login successful for user araf on display 10
    Sep 14 20:31:05 Brother-Eye xrdp[1030]: [INFO ] loaded module ‘libxup.so’ ok, interface size 10296, version 4
    Sep 14 20:31:05 Brother-Eye xrdp[1030]: [INFO ] started connecting
    Sep 14 20:31:05 Brother-Eye xrdp[1030]: [INFO ] lib_mod_connect: connecting via UNIX socket
    Sep 14 20:34:35 Brother-Eye xrdp[1030]: [INFO ] connection problem, giving up
    Sep 14 20:34:35 Brother-Eye xrdp[1030]: [INFO ] some problem
    Sep 14 20:34:35 Brother-Eye xrdp[1030]: [ERROR] xrdp_wm_log_msg: Error connecting to user session
    Sep 14 20:34:35 Brother-Eye xrdp[1030]: [INFO ] Error connecting to user session
    **********************************************************************************************************************

    I had xfce4 and xrdp setup on wsl2 ubuntu -20.04 before and everything worked nicely with RDP with 172.20.#.#, after updating 20.04 to 22.04 things stopped working. So, I fresh installed ubuntu-22.04 and tried again. Any help will be appreciated.

  27. @Akil;

    Thank you for visiting our blog and sharing your findings. We never used the wsl2 with full gui. So, we do not know what could be the problem at this stage… We would need to test this setup…this might take some time before we coming back to you as we are quite busy with work and we are trying to publish some new posts related to xRDP. We will definitely have a look since more people are asking about this specific setup (WSL + GUI + XRDP)

    Stay Tuned
    Till next time
    See ya

  28. this script is usefull.
    I have Ubuntu 22.04.3 LTS. need install make first on fresh install ubuntu minimal.
    sudo apt install make then run this script
    Thankyou

Leave a Reply