xRDP – Install xRDP the easy way on Ubuntu 18.04.x and 19.04 (Scripted Installation – Version 0.6.1)

 

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

 

Hello World, 

This post will be quite short.  Based on some users comments and feedback, we have detected a small issue with our famous script to perform a standard xRDP installation on Ubuntu 18.04.3 specifically.   After a quick investigation, we have found the issue and we have fixed it.  The question was for us to either update the script and not changing the numbering or update the script and change the numbering.  We decided to change the numbering in order to bring awareness  with this issue.   The change is really minor.  We have modified the logic that used to check Ubuntu 18.04.x version.   The version 0.6 of the script would not perform the correct action if you are running it on Ubuntu 18.04.3 version.   The script would work up to Ubuntu 18.04.2 version as the logic detect this correctly and will apply the proper fix.  The problem is related to the fact that Ubuntu 18.04.2 is relying on xorg-xserver-core-hw* libraries which cannot be used when using the xrdp package stored in Ubuntu repositories.   You can real the full story here.

Overview

Ubuntu 18.04.2 and later are relying on xorg-xserver-core-hw* packages that are incompatible with the xrdp packaged provided by Ubuntu.  When you try to perform a manual installation of xrdp package on Ubuntu 18.04.2 or 18.04.3, the installation of xorgserver package will fail because it relies on the xorg-xerver-core* packages.  The script version 0.6 was taking into account this issue only up to Ubuntu 18.04.2.  We thought that Canonical would have fixed this issue in the latest Point release 18.04.3.  Actually, this is not the case and the issue still remains.  Because of this, we have performed a minor update on the Standard installation script in order to include Point release 18.04.3 (and probably later versions of Point releases) 

Prerequisites and assumptions

We assume that you have internet connection available and that you are indeed running one of the following version of Ubuntu 

  • Ubuntu 18.04 (up to Ubuntu 18.04.3)
  • Ubuntu 18.10
  • Ubuntu 19.04 
  • We have performed the test on a Virtual Machine running on Virtual box (on Windows 2012 R2) with Sound enabled !!!
  • No additional Desktop interface will be used. The remote desktop session will display the Ubuntu tweak Gnome Desktop interface

The script version 0.6.1

Important Note :

If you copy/paste the script, you might encounter some issues because font formatting might be not maintained during the copy/paste operation. Please ensure that format is  accurate before launching the script. A downloadable version of the script is available at the bottom of the post

Disclaimer : As usual, use this at your own risk !!

#!/bin/bash
#####################################################################################################
# Script_Name : Std-Xrdp-install-0.6.1.sh
# Description : Perform an automated standard installation of xrdp
# on ubuntu 18.04 and later
# Date : Sept 2019
# written by : Griffon
# Web Site :http://www.c-nergy.be - http://www.c-nergy.be/blog
# Version : 0.6.1
# History : 0.6.1 - Added support for Ubuntu 18.04.3 
#         : 0.6   - Added support for Ubuntu 19.04 
#                 - New code for Look'n feel using xsessionrc method
#                 - New code for enabling Sound Redirection - compiling from source 
#                 - Removed -g parameter 
#         : 0.5.3 - Using Unoffical xRDP packages for Ubuntu 18.04.2 issue
#         : 0.5.2 - Quick Fix for Ubuntu 18.04.2
#         : 0.5.1 - Add support to Ubuntu 18.10 
#         : 0.5 - Add logic to enable sound redirection 
#               - re-write code logic to include functions
#               - Removed support for Ubuntu 17.10 as reached end of support
#         : 0.4 - Add logic to fix GDM lock screen + minor change
#         : 0.3 - Adding logic to fix theme and extensions for any users login through xrdp
#           0.2 - Added Logic for Ubuntu 17.10 and 18.04 detection 
#              - Updated the polkit section
#              - New formatting and structure 
#         : 0.1 - Initial Script 
# Disclaimer : Script provided AS IS. Use it at your own risk....
####################################################################################################
#---------------------------------------------------#
# Detecting if Parameters passed to script .... 
#---------------------------------------------------#

while getopts s:u: option 
do 
case "${option}" 
in 
s) fixSound=${OPTARG};;
u) unofficialRepo=${OPTARG};; 
esac 
done

#---------------------------------------------------#
# Script Version information Displayed #
#---------------------------------------------------#

echo
/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;36m ! Standard XRDP Installation Script - Ver 0.6.1                 !\e[0m"
/bin/echo -e "\e[1;36m ! Written by Griffon - Sept 2019 - www.c-nergy.be              !\e[0m"
/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"
echo

#--------------------------------------------------------------------------#
# -----------------------Function Section - DO NOT MODIFY -----------------#
#--------------------------------------------------------------------------#

#-----------------------------------------------------#
# Function 0 - Quick and Dirty Patch Ubuntu 18.04.x   #
#-----------------------------------------------------#

install_xservercore() 
{
echo
/bin/echo -e "\e[1;33m !----------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;33m ! Installing xserver-xorg-core Packages...Proceeding... !\e[0m"
/bin/echo -e "\e[1;33m !----------------------------------------------------------!\e[0m"
echo
sudo apt-get install xserver-xorg-core -y
echo
/bin/echo -e "\e[1;33m !----------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;33m ! Installing xserver-xorg-input-all pkg...Proceeding... !\e[0m"
/bin/echo -e "\e[1;33m !----------------------------------------------------------!\e[0m"
echo
sudo apt-get -y install xserver-xorg-input-all 
}

#---------------------------------------------------#
# Function 1 - Install xRDP Software.... 
#---------------------------------------------------#

install_xrdp() 
{
echo
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
/bin/echo -e "\e[1;33m ! Installing XRDP Packages...Proceeding... !\e[0m"
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
echo
sudo apt-get install xrdp -y 
}

#---------------------------------------------------#
# Function 2 - Install Gnome Tweak Tool.... 
#---------------------------------------------------#

install_tweak() 
{
echo
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
/bin/echo -e "\e[1;33m ! Installing Gnome Tweak...Proceeding... !\e[0m"
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
echo
sudo apt-get install gnome-tweak-tool -y
}

#--------------------------------------------------------------------#
# Fucntion 3 - Allow console Access ....(seems optional in u18.04)
#--------------------------------------------------------------------#

allow_console() 
{
echo
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
/bin/echo -e "\e[1;33m ! Granting Console Access...Proceeding...     !\e[0m"
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
echo
sudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config
}

#---------------------------------------------------#
# Function 4 - create policies exceptions .... 
#---------------------------------------------------#

create_polkit()
{
echo
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
/bin/echo -e "\e[1;33m ! Creating Polkit File...Proceeding... !\e[0m"
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
echo

sudo bash -c "cat >/etc/polkit-1/localauthority/50-local.d/45-allow.colord.pkla" <<EOF
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes

[Allow Package Management all Users]
Identity=unix-user:*
Action=org.debian.apt.*;io.snapcraft.*;org.freedesktop.packagekit.*;com.ubuntu.update-notifier.*
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF

}

#---------------------------------------------------#
# Function 5 - Fixing Theme and Extensions .... 
#---------------------------------------------------#

fix_theme()
{
echo
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
/bin/echo -e "\e[1;33m ! Fix Theme and extensions...Proceeding...    !\e[0m"
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
echo
sudo sed -i.bak "4 a #Improved Look n Feel Method\ncat <<EOF > ~/.xsessionrc\nexport GNOME_SHELL_SESSION_MODE=ubuntu\nexport XDG_CURRENT_DESKTOP=ubuntu:GNOME\nexport XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg\nEOF\n" /etc/xrdp/startwm.sh
echo
}

#---------------------------------------------------#
# Function 6 - Enable Sound Redirection .... 
#---------------------------------------------------#

enable_sound()
{
echo
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
/bin/echo -e "\e[1;33m ! Enabling Sound Redirection...               !\e[0m"
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"
echo

# Step 1 - Enable Source Code Repository
sudo apt-add-repository -s 'deb http://be.archive.ubuntu.com/ubuntu/ '$codename' main restricted'
sudo apt-add-repository -s 'deb http://be.archive.ubuntu.com/ubuntu/ '$codename' restricted universe main multiverse'
sudo apt-add-repository -s 'deb http://be.archive.ubuntu.com/ubuntu/ '$codename'-updates restricted universe main multiverse'
sudo apt-add-repository -s 'deb http://be.archive.ubuntu.com/ubuntu/ '$codename'-backports main restricted universe multiverse'
sudo apt-add-repository -s 'deb http://be.archive.ubuntu.com/ubuntu/ '$codename'-security main restricted universe main multiverse'
sudo apt-get update

# Step 2 - Install Some PreReqs
sudo apt-get install git libpulse-dev autoconf m4 intltool build-essential dpkg-dev -y
sudo apt build-dep pulseaudio -y

# Step 3 - Download pulseaudio source in /tmp directory - Do not forget to enable source repositories
cd /tmp
sudo apt source pulseaudio

# Step 4 - Compile
pulsever=$(pulseaudio --version | awk '{print $2}')
cd /tmp/pulseaudio-$pulsever
sudo ./configure

# step 5 - Create xrdp sound modules
sudo git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
cd pulseaudio-module-xrdp
sudo ./bootstrap 
sudo ./configure PULSE_DIR="/tmp/pulseaudio-$pulsever"
sudo make

#Step 6 copy files to correct location (as defined in /etc/xrdp/pulse/default.pa)
cd /tmp/pulseaudio-$pulsever/pulseaudio-module-xrdp/src/.libs
sudo install -t "/var/lib/xrdp-pulseaudio-installer" -D -m 644 *.so
sudo install -t "/usr/lib/pulse-$pulsever/modules" -D -m 644 *.so
echo

}


fix_ssl() 
{ 
echo 
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m" 
/bin/echo -e "\e[1;33m ! Fixing SSL Cert Issue ...                   !\e[0m" 
/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m" 
echo 
sudo adduser xrdp ssl-cert 
}
#--------------------------------------------------------------------------#
# -----------------------END Function Section -----------------#
#--------------------------------------------------------------------------#
#--------------------------------------------------------------------------#
#------------ MAIN SCRIPT SECTION -------------------# 
#--------------------------------------------------------------------------#
#---------------------------------------------------#
#-- Step 0 - Try to Detect Ubuntu Version.... 
#---------------------------------------------------#

version=$(lsb_release -sd) 
codename=$(lsb_release -sc)

echo
/bin/echo -e "\e[1;33m |-| Detecting Ubuntu version \e[0m"

if [[ "$version" = *"Ubuntu 18.04"* ]];
then
/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"
echo
elif [[ "$version" = *"Ubuntu 18.10"* ]];
then
/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"
echo
elif [[ "$version" = *"Ubuntu 19.04"* ]];
then
/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"
echo
else
/bin/echo -e "\e[1;31m !------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;31m ! Your system is not running Ubuntu 18.04 Edition and later !\e[0m"
/bin/echo -e "\e[1;31m ! The script has been tested only on Ubuntu 18.04 and later !\e[0m"
/bin/echo -e "\e[1;31m ! The script is exiting... !\e[0m" 
/bin/echo -e "\e[1;31m !------------------------------------------------------------!\e[0m"
echo
exit
fi

/bin/echo -e "\e[1;33m |-| Detecting Parameters \e[0m"

#Detect if argument passed
if [ "$fixSound" = "yes" ]; 
then 
/bin/echo -e "\e[1;32m |-| Sound Redirection Option...: [YES]\e[0m"
else
/bin/echo -e "\e[1;32m |-| Sound Redirection Option...: [NO]\e[0m"
fi

if [ "$unofficialRepo" = "yes" ]; 
then 
/bin/echo -e "\e[1;32m |-| Unofficial Repo...........: [YES]\e[0m"
else
/bin/echo -e "\e[1;32m |-| Unofficial Repo...........: [NO]\e[0m"
fi
echo

#---------------------------------------------------------#
# Step 2 - Executing the installation & config tasks .... #
#---------------------------------------------------------#

echo
/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;36m ! Installation Process starting.... !\e[0m"
/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"
echo
/bin/echo -e "\e[1;33m |-| Proceed with installation..... \e[0m"
echo

if [[ "$version" = *"Ubuntu 18.04."* ]];
then
/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"
echo
/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;36m ! Applying Installation Patch for Ubuntu 18.04.2 Only !\e[0m"
/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"
echo
if [ "$unofficialRepo" = "yes" ];
then
/bin/echo -e "\e[1;32m => Downloading Unofficial xRDP packages (Thiago Martins) !\e[0m"
echo
sudo add-apt-repository ppa:martinx/xrdp-hwe-18.04 -y
sudo apt-get update
install_xrdp
install_tweak
allow_console
create_polkit
fix_theme
fix_ssl
else
/bin/echo -e "\e[1;32m => Downgrading to previous xserver-xorg-* packages !\e[0m"
echo
install_xservercore
install_xrdp
install_tweak
allow_console
create_polkit
fix_theme
fi
else
install_xrdp
install_tweak
allow_console
create_polkit
fix_theme
fix_ssl
fi

if [ "$fixSound" = "yes" ]; 
then 
enable_sound
fi

#---------------------------------------------------#
# Step 9 - Credits .... 
#---------------------------------------------------#
echo
/bin/echo -e "\e[1;36m !------------------------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;36m ! Installation Completed !\e[0m" 
/bin/echo -e "\e[1;36m ! Please test your xRDP configuration.A Reboot Might be required... !\e[0m"
/bin/echo -e "\e[1;36m ! Written by Griffon - Sept 2019 - Ver 0.6.1 - Std-Xrdp-Install-0.6.1sh !\e[0m"
/bin/echo -e "\e[1;36m ! !\e[0m"
/bin/echo -e "\e[1;36m ! Thanks to Thiago Martins who provided Updated xRDP packages for 18.04.2 :-) !\e[0m"
/bin/echo -e "\e[1;36m !------------------------------------------------------------------------------!\e[0m"
echo

How to Use the Script

Again, script usage is basically the same as the previous versions.  We will not go into details here but simply explain how to use it and how to execute it. 

Step 1 – Set Execute Right on the script

Download the Std-Xrdp-install-0.6.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/Std-Xrdp-Install-0.6.1.sh

Note : Adjust the path where the Std-Xrdp-Install-0.6.1.sh script to reflect your environment

Step 2 – How to execute the script ? 

With this version of the script, you can decide to pass no parameters or pass 2 parameters (which are -s  -u). The following section explains what are these options   

Standard way

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 

 ./Std-Xrdp-Install-0.6.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….

This installation mode will downgrade to older Ubuntu packages that can be used with xRDP and xorgxrdp packages if you are running Ubuntu 18.0.4.2 or 18.0.4.3.  This installation mode uses the quick and dirty fix…. 

Advanced way – Sound redirection 

If you want to use sound redirection within your remote session, you will need to run the script with the -s parameter.  When the -s parameter is passed, the sound redirection function will be executed and all the necessary actions would be performed by the script that will allow sound redirection.  To enable this additional feature within your remote desktop session, you will need to user the following syntax

To implement the sound redirection fix  within the xrdp session, use this syntax

./Std-Xrdp-Install-0.6.1.sh -s yes

When script execution is completed, the machine will not reboot so you can review the installation and detect possible elements that’s preventing the script execution.  At completion, it’s recommended to reboot the machine so the changes made to the system can be applied accordingly. 

Custom Option – using unofficial xRDP packages (use it if running Ubuntu 18.04.2 or 18.0.4.3)

If you are running Ubuntu 18.04.2 or later, you know that a small issue has been detected when installing the standard xrdp packages.  The issue will prevent the installation of the xorgxrdp package which will result in not being able to perform remote connection.  The script will detect this operating system and will take corrective actions in order to ensure that xrdp functionality will work after the installation process. 

However, the remediation process implies that some packages will be downgraded to a working version.  Some people might not like this approach.  So, we have included in the version 0.6 of the script the possibility to use unofficial xRDP packages that will be compatible with Ubuntu 18.04.2 while keeping the most recent version of needed packages to have xrdp installed properly. 

 If you want to use the unofficial xRDP packages, you will need to issue the following command 

./Std-Xrdp-Install-0.6.1.sh -u yes

This command will add some additional ppa repositories and will use these packages to perform the xRDP installation.  It’s important to note that this option will only work when running the script on Ubuntu 18.04.2 or later.  The script will check if you are running this version specifically and if you have used the -u option, unofficial packages will be used.

Obviously, you can combine the -s and -u parameters if you are running Ubuntu 18.04.2 operating system and you want to use sound redirection as well… 

./Std-Xrdp-Install-0.6.1.sh -u yes -s yes

Step 3 – Test your configuration 

After the script has run and after the reboot, it’s time to test and see if you can indeed perform a smooth remote connection to your Ubuntu machine.  Remember that a user can either be logged on locally or logged on remotely on the machine when working with xRDP solution.  If the user, performing the remote connection, is logged into the system locally the remote connection will start but will be terminated immediately.  This is the way it works nowadays. 

So, ensure that the user performing the test is not locally logged on, start your favourite remote desktop client and perform your connection.  You will be presented with the green login screen. Enter your credentials.  If everything is ok, you should then see your Ubuntu desktop displayed in the remote session.  You should be good to go and start performing some of your work.  If you disconnect from your session, you should be able to reconnect to the same session and proceed with the work you were doing.   

Download the Script 

Please download the script :  Std-Xrdp-Install-0.6.1.zip

Final Notes

This is it for this “fast published” post !   

The Std installation script now includes proper support for Ubuntu 18.04.3 release and we can enjoy again a simple and smooth installation.  This would be probably the latest update of this script version.  As you are probably aware, we are working in merging custom and standard script into a single one (see here) which should allow us to follow in a more timely manner release cycles.  The script has not been fully tested and validated yet. So, if you have some time, give it a try and provide feedback.  If you find a bug or an issue with the script, let us know as well so we can try to fix it 

Stay tuned

That’s is for today 

Till next time 

 

 

 

 

 

32 thoughts on “xRDP – Install xRDP the easy way on Ubuntu 18.04.x and 19.04 (Scripted Installation – Version 0.6.1)

  1. @Ian,

    Thank you for letting us know… It has been fixed…. The link points to the correct file now….:-)
    Sorry for the inconvenience….

    Till next time
    See ya

  2. I have installed Std-Xrdp-Install-0.6.1.zip. And I can see the bug. When I launch an app to install new apps (GNOME Software) I can see: ¨ Unable to download updates: you do not have permission to install software. ¨ (RDP client: Remina, xRDP server: 19.04)

  3. The problem is wider. I enter the password, but I still can see “Authentication required. System policy prevents wi-fi scans”. I click “cancel” but I cam the same. So I cannot enter the system.

  4. @Dimitri;

    This is a known limitation of xRDP. Ubuntu is using Polkit technology. Polkit define what a local user is entitled to do on the system. Polkit also applies to remote connection where polkit is probably more restrictive..This is why you have the prompt for the password….and if you enter it, it’s probably showing you again a popup….

    We will write a post about that topic as it seems enough people are not aware of the polkit technology and limitations that can come from it….

    till next time
    See ya

  5. Hey buddy!

    My PPA isn’t required any more! 😀

    So, you can remove the code here:

    sudo add-apt-repository ppa:martinx/xrdp-hwe-18.04 -y

    …and adapt the script to use the new package:

    Now, Ubuntu fixed the problem and a new package is available on official repositories, called “xorgxrdp-hwe-18.04”, how cool is that!? lol

    Cheers!
    Thiago

  6. @Thiago;

    Thank you for the update about new xorgxrdp package…. I didn’t know that a new package was available…. will update posts/scripts accordingly

    Till next time
    See ya

  7. A long series of attempts to get the XRDP running on an Ubuntu VM, I finally found the solution. I use Parallels on my Mac. No matter which Ubuntu version, no matter which XRDP version or installation type I chose, the screen after logging in via XRDP was black.

    Now I have updated to the Parallels version 15, as there should be possible to operate the Ubuntu 19.04 without driver tools.

    I tested it with and without tools.
    Result: XRDP works great as long as you do not install the tools.

    I hope this helps others too.

  8. @Chris,

    Thank you for sharing the info and providing feedback on your testing and solution
    indeed, this can be helpful to other
    Thanks for your effort
    Till next time
    See ya

  9. I created this to solve my Wi-Fi Scan popup. I use x2go for remote access, but should work the same for all.

    sudoedit /etc/polkit-1/localauthority/50-local.d/50-allow-wifiscan.pkla

    [Allow WiFiScan all Users]
    Identity=unix-user:*
    Action=org.freedesktop.NetworkManager.wifi.scan
    ResultAny=no
    ResultInactivity=no
    ResultActive=yes

  10. Since the release of 20.04 on Apri 23, 2020 I had to update your script in the elif part, but other than that it worked like a charm. Added around line 245.
    elif [[ “$version” = *”Ubuntu 20.04″* ]];
    then
    /bin/echo -e “\e[1;32m |-| Ubuntu Version : $version\e[0m”
    echo

  11. @Andy,

    Thanks for the feedback and for visiting and using our script. We had some delays in releasing the script version 1.2 for the xrdp… As you mentioned, the version 1.1 should be working if tweaked to add Ubuntu 20.04 support.

    New version fixes some minor bugs and should be released soon (end April 2020 or beginning of May 2020)

    Till next time
    See ya

  12. Hello, I’m using Ubuntu 18.04.4 on NVIDIA Jetson TX1 devboard (Kernel: 4.9.140-tegra aarch64).
    Installing Xrdp with the given script is flawless, and I can connect to the server login screen (with the atom logo).
    However, when I try to login by entering username and password, the screen turns black and the Windows RDP client closes. Is there any way I can resolve this issue?
    Thanks!

  13. @Kim,

    The script you are using is a little bit out dated and has been replaced by a new version of the script. However,it should be still valid. The most recent version of the script can be found at xRDP – Easy install xRDP on Ubuntu 16.04,18.04,19.10 & 20.04 (Script Version 1.2).

    Usually, the black screen symptoms after passing credentials on the xRDP login dialog box can be due to

    The user account that perform the remote connection is already logged in locally on the machine. The same user account can be either connected locally or remotely not both at the same time
    The xorg-xserver-core package is not installed correctly or version is not correct (->This does not seems to be your problem)
    Check that the xorgxrdp package is installed correctly (issue the following command to assess is installed correctly sudo apt-get install xorgxrdp

    if this is not solving the issue; you will have to look into the logs
    /var/log/xrdp.log and /var/log/xrdp-sesman.log to see if there is a hint that could explain why you have the black screen issue

    Hope this help
    Till Next time
    See ya

  14. @Thiago Martins
    xrdp-hwe-18.04 is NOT available in ubuntu repositories. I still get package not found.

    I am updated to Ubuntu 18.04.5 LTS and still this package is not found.
    Where is it???

  15. @Jdawiz,

    Thank you for visiting our blog and share….hmmm your frustations…
    I understand that some issues can be frustrating but first thing first…we would need more information about your configuration

    Is this a physical machine or a virtual machine ?
    which version of Ubuntu are your running (lsb_release -a)
    do you have xrdp package already installed (check by issuing the following command xrdp -v)
    To check the package version for xorgxrdp, can you issue the following command dpkg -l | grep xorgxrdp => what do you see ?

    Have you tried to download the missing package from ubuntu repository web site (https://packages.ubuntu.com/bionic-updates/xorgxrdp-hwe-18.04) and you can also download the package from this url https://packages.ubuntu.com/bionic-updates/amd64/xorgxrdp-hwe-18.04/download. Once downloaded, you can install it using dpkg -i <%name of the deb package %>

    The issue seems to be with your Ubuntu machine not able to retrieve the package. We have installed a brand new Ubuntu 18.04.5 and we have been able to retrieve the necessary packages…..
    (see screenshot at https://c-nergy.be/downloads/debug_xorgxrdp_hwe_18.04.png)

    Finally, you can use the latest version of the script and perform a custom installation as well where the proper xorgxrdp package will be compiled for you… have a look at https://c-nergy.be/blog/?p=15978 and use the switch -c to perform the custom installation

    Hope this help
    Till next time
    See ya

  16. @Griffon,

    Thanks for your reply. My frustration is over 2 years of not being able to remote desktop to this machine.
    I connect with putty terminal as there is always a user logged in directly to the physical machine.
    This is a physical machine.
    Hardware specs. ASUS ROG Strix Z390-I, Intel i7 4 core with 32 gig memory, nvidia geforce gtx 1650

    lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 18.04.5 LTS
    Release: 18.04
    Codename: bionic

    I purged all packages that start with xrdp because I did not want any bad configuration around that might hinder the process.

    I then installed xrdp and tried to install xorgxrdp-hwe-18.04.
    this is what I get when I install xorgxrdp-hwe-18.04 using apt-get.

    sudo apt-get install xorgxrdp-hwe-18.04
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package xorgxrdp-hwe-18.04
    E: Couldn’t find any package by glob ‘xorgxrdp-hwe-18.04’
    E: Couldn’t find any package by regex ‘xorgxrdp-hwe-18.04’

    When I run
    apt-cache search xorgxrdp* I get nothing back.
    dpkg -l | grep xorgxrdp also returns no result.

    I know I have the right repository so I did not list all of them here only the pertinent one.
    My repository is deb http://us.archive.ubuntu.com/ubuntu/ bionic universe and I can browse there manually to the folder where it is suppose to be and I see the package.
    http://us.archive.ubuntu.com/ubuntu/pool/universe/x/xrdp-hwe-18.04/ and can see the package
    xorgxrdp-hwe-18.04_0.9.5-2~18.04.1_amd64.deb

    I thought about installing it manually like you suggest but I am still very new to this and did not want to mess my machine up any more that it is.

    Are packages in the repository indexed somewhere so that apt knows where to find them? I noticed that the repository part of the script did not have the “us.” in front of it. Are “us” packages updated on a different timeline then other countries?

    Additionally, I have had multiple issues with gnome desktop (especially with my nvidia drivers) and heard that it does not play well with remote desktop if a user is logged in to the machine directly which in my case will always be the case. But that should have nothing to do with installing a package and I may just be rambling. I am not very fond of gnome anyway and have been thinking of switching to KDE.

    I will try to install the package directly with dpkg and see if I get any further. Will post back here with my result.

    Thanks,
    jdawiz.

  17. @Griffon,
    Looks like there is a dependency issue with xorgxrdp-hwe-18.04.
    I don’t really know how to fix this but it won’t install.
    Dependencies.
    xserver-xorg-core-hwe-18.04 xorg-video-abi-24

    sudo dpkg -i xorgxrdp-hwe-18.04_0.9.5-2~18.04.1_amd64.deb
    Output:
    Selecting previously unselected package xorgxrdp-hwe-18.04.
    dpkg: considering removing xorgxrdp in favour of xorgxrdp-hwe-18.04 …
    dpkg: yes, will remove xorgxrdp in favour of xorgxrdp-hwe-18.04
    (Reading database … 219197 files and directories currently installed.)
    Preparing to unpack xorgxrdp-hwe-18.04_0.9.5-2~18.04.1_amd64.deb …
    Unpacking xorgxrdp-hwe-18.04 (0.9.5-2~18.04.1) …
    dpkg: dependency problems prevent configuration of xorgxrdp-hwe-18.04:
    xorgxrdp-hwe-18.04 depends on xorg-video-abi-24; however:
    Package xorg-video-abi-24 is not installed.
    Package xserver-xorg-core-hwe-18.04 which provides xorg-video-abi-24 is not installed.
    xorgxrdp-hwe-18.04 depends on xserver-xorg-core-hwe-18.04 (>= 2:1.18.99.901); however:
    Package xserver-xorg-core-hwe-18.04 is not installed.

    dpkg: error processing package xorgxrdp-hwe-18.04 (–install):
    dependency problems – leaving unconfigured
    Errors were encountered while processing:
    xorgxrdp-hwe-18.04

    Thanks,
    Jdawiz

  18. @Jdawiz,

    Thanks for providing some more information….So, at fist glance, we would say that you have multiple issues here…..So, let’s tackle issues one by one….

    Issue 1 – Ubuntu repositories not fully configured. This is probably why you do not get all the packages. can you issue the following commands on your computer
    sudo add-apt-repository main
    sudo add-apt-repository universe
    sudo add-apt-repository restricted
    sudo add-apt-repository multiverse
    sudo apt-get update

    wait for completion… When done, try again the following command

    dpkg -l | grep xorgxrdp

    and tell us if some output are shown this time

    Waiting for your feedback and then we can see if we can move forward….

    Hope this help
    Till next time
    See ya

  19. @Griffon,

    I updated the repositories as suggested. Strange because event though I had all of the above repositories, as seen by the output, and I had run sudo apt-get update about a billion times, I now get an output for dpkg -l | grep xorgxrdp

    ‘main’ distribution component is already enabled for all sources.
    ‘universe’ distribution component is already enabled for all sources.
    ‘restricted’ distribution component is already enabled for all sources.
    ‘multiverse’ distribution component is already enabled for all sources.

    dpkg -l | grep xorgxrdp
    Output
    ic xorgxrdp 0.9.5-2 amd64 Remote Desktop Protocol (RDP) modules for X.org
    iU xorgxrdp-hwe-18.04 0.9.5-2~18.04.1 amd64 Remote Desktop Protocol (RDP) modules for X.org

    Issue 1 Resolved.

    Thanks,
    jdawiz

  20. @Griffon,

    This is really strange. Before I ran the repository commands you suggested, I backed up my /etc/apt/sources.list to sources.list.bak. Then I used Beyond Compare to compare it to the original after the update. They are identical. What else does this “add-apt-repository” command change?

    Please forgive the newbie questions. I am a Windows Developer for over 30 years but very new to Linux.

    Thanks,
    jdawiz

  21. @jdawiz,

    Aahh, Good to hear… so we are making some progress here….. As you said issue 1 should be resolved by now.
    The add-apt-repository simply provides a list of sources where your Ubuntu machine can find updates and software….We wanted to be sure that your system was configured and pointing to the correct Ubuntu Repositories

    The apt-get update basically updates the system and tell him which packages can be installed (after you have added ubuntu repositories or other repositories)

    Let’s tackle Issue 2 – Installing the xRDP Software

    At this stage, you should be able to retrieve the necessary package needed to perform the xrdp installation.
    Perform a manual installation or use our xrdp-installer script

    You can try to perform a manual installation by issuing the following command

    sudo apt-get install xrdp
    sudo apt-get install xorgxrdp-hwe-18.04

    If the installation succeeds, you can try to perform a remote desktop connection (-> you might not be able to login right away to your ubuntu desktop and the desktop layout in your remote session might be different than the classical Ubuntu Desktop !!!)

    You can use our xrdp-installer script (latest version 1.2.2 – can be found for free at https://www.c-nergy.be/products.html . Please read also the instructions on how to use the script….

    If you never used the xrdp-installer script, you can run the following commands to download it and install it

    cd ~/Downloads
    wget https://www.c-nergy.be/downloads/xrdp-installer-1.2.2.zip
    unzip xrdp-installer-1.2.2.zip
    chmod +x ~/Downloads/xrdp-installer-1.2.2.sh
    ./xrdp-installer-1.2.2.sh -l

    Wait for installation to complete. Then logoff from the system and try perform a remote login session. If xRDP is installed correctly, you should see a purple background and a dialog box to pass your credentials.
    Reminder : the same user cannot have at the same time a session open locally on the UBuntu machine and remotely via xRDP. it’s either or.

    If you used at least once, one of the latest version of our xrdp-installer script, you have to either run it in removal mode or you will have to manually remove xrdp package
    if you have used any version between xrdp-installer-1.0.sh up to xrdp-installer-1.2.2.sh, you can remove the software by issuing the command
    ./xrdp-installer-1.2.2.sh -r

    If you have used any other versions of the script, you will have to manually remove the xrdp package by issuing the following command
    sudo apt-get remove xrdp
    You might also need to delete the folder /etc/xrdp manually
    When this is done, you can try to run the latest version of the installer script

    cd ~/Downloads
    wget https://www.c-nergy.be/downloads/xrdp-installer-1.2.2.zip
    unzip xrdp-installer-1.2.2.zip
    chmod +x ~/Downloads/xrdp-installer-1.2.2.sh
    ./xrdp-installer-1.2.2.sh -l

    wait for completion – Check if any errors occurred and try your remote desktop session

    Final Words – If the xRDP installation is successful, you might be able to access the xRDP login screen but you will not get access to the UBuntu destkop on the REmote session. You might get disconnected immediately after the xRDP login. This is your third issue. You are using nVidia Graphic Cards which does not play well with xRDP…..

    If you succeed in fixing issue 2, we could try to provide some help or workaround in order to fix issue 3 if you encountered it

    Waiting for your feedback
    Till next time
    See ya

  22. @Griffon,

    Ok here is where I am.

    sudo apt-get install xorgxrdp-hwe-18.04.
    ERROR OUTPUT:
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package xorgxrdp-hwe-18.04 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘xorgxrdp-hwe-18.04’ has no installation candidate
    END OUTPUT

    This still did not work. It would still not install. See Error output.
    I download it and tried to install manually again.

    cd /Downloads
    wget http://us.archive.ubuntu.com/ubuntu/pool/universe/x/xrdp-hwe-18.04/xorgxrdp-hwe-18.04_0.9.5-2~18.04.1_amd64.deb
    sudo dpkg -i xorgxrdp-hwe-18.04_0.9.5-2~18.04.1_amd64.deb

    Still would not install because of a dependency on xserver-xorg-core-hwe-18.04.
    Apparently an older version was installed xserver-xorg-core.

    I had to remove it
    sudo apt –fix-broken install
    sudo apt remove xserver-xorg-input-wacom
    sudo apt remove xserver-xorg-core

    Yes I have a Wacom Tablet installed which is probably why that package was installed.

    Once removed I tried to installed xserver-xorg-core-hwe-18.04 package
    sudo apt-get install xserver-xorg-core-hwe-18.04
    This also failed with a similar output as above.
    Package xserver-xorg-core-hwe-18.04′ has no installation candidate.
    (I don’t know what this means)

    I had to download it with
    wget http://http://us.archive.ubuntu.com/ubuntu/pool/main/x/xorg-server-hwe-18.04/xserver-xorg-core-hwe-18.04_1.20.8-2ubuntu2.2~18.04.4_amd64.deb

    Then install it using:
    sudo dpkg -i xserver-xorg-core-hwe-18.04_1.20.8-2ubuntu2.2~18.04.4_amd64.deb

    Then installed:
    sudo dpkg -i xorgxrdp-hwe-18.04_0.9.5-2~18.04.1_amd64.deb

    This worked.
    I am now able to connect to remote desktop. (Two Years Later WOW!)

    Please help me to understand why I needed to install using dpkg instead of apt-get.
    Is there something wrong with my Repository, Package Manager etc???
    I am thinking this is another issue. Issue 4.

    Issue 3.
    I can login at the first login prompt which has 3 boxes
    First Login Screen
    Session, Username, password.
    Login Successful
    Second Login Screen
    Authentication Required
    Password
    If I cancel 3 times I can get in and everything seems fine.
    What is with this second Authentication screen?

    Can you provide any help for issue 4 also.

    Thanks,
    jdawiz

  23. @jdawiz,

    Thank you for the feedback… so it seems you have made some progress. If I understand correctly, you are now able to perform a remote desktop connection but when acquiring the remote session, you see a authentication dialog box. We are assuming that you see a message like Authentication Required to Create Managed Color Device. It will popup 2 or 3 times… To fix this issue, please follow these steps

    1. Open a Terminal Console
    2. Type sudo su
    3. type cd /etc/polkit-1/localauthority/50-local.d
    4. type ls Check if a file 45-allow-colord.pkla
    5. if the file does not exists, you will have to create it. Open a text editor by typing gedit
    6. Copy the text below in the gedit text editor

    [Allow Colord all Users]
    Identity=unix-user:*
    Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
    ResultAny=no
    ResultInactive=no
    ResultActive=yes

    7. Save the file and with the name 45-allow-colord.pkla
    8. check that the file has been created accordingly
    9. quit your terminal session and logoff from your ubuntu machine
    10. Try you remote desktop connection and see if the authentication popup is still showing up

    You can find more information about the Why of the dialog box by reading the following posts (please read both of them to have full information)

    xRDP – The Infamous “Authentication Required to Create Managed Color Device” Explained
    xRDP – How to Fix the Infamous system crash popups in Ubuntu 18.04 (and previous versions)

    Waiting for your feedback.

    Till next time
    See ya

  24. Good morning,

    and thank you for the great installation script. I could use this without problems with the standard installation (no parameters) under Ubuntu 18.04.5 LTS.
    But here’s my question. I’m using software on the remote machine that needs the capabilities of the nvidia cuda, vulkan and such things. But the hardware seems not be used here (more like software rendering?). The remote machine is using nvidia driver 465 and cuda 10.1 (if it helps for investigation).

    Is there a way to use the xrdp with all the hardware capabilities?

    Best regards
    grinsekatze

  25. @grinsekatze,

    xRDP is known not to work properly with nvidia Graphical cards. We try to avoid nvidia graphic cards when using xRDP or if we have system with nVidia cards, we fallback to the Xorg driver because we know that the xRDP software would work….

    Hope this help
    Till next time
    See ya

Leave a Reply