/Installing-and-setting-up-xrdp-on-Ubuntu-22.04

How to install and configure xrdp on Ubuntu 22.04 LTS

Creative Commons Zero v1.0 UniversalCC0-1.0

Installing and setting up xrdp on Ubuntu 22.04.3 LTS

Prerequistes

  1. A working knowledge of Linux and how to install it on real hardware or in a Virtual Environment.
  2. A running Ubuntu Gnome Desktop installed on hardware or a virtual machine, (mine is running on a Proxmox Virtual Machine).

Setting up Gnome with xrdp

Download and install the Gnome Desktop

The next parts of the installation will need to be done on the Ubuntu Desktop, if it's a virtual install then via the virtual console, if it's on real hardware then with a keyboard, mouse and monitor connected. Depending on how you installed Ubuntu, you'll have to add yourself to the sudo group, to check that you're in the sudo group type the following at the prompt.

id

Instructructions on adding yourself to the group are here

Run through the Ubuntu installer and update, then install xrdp

apt update && apt upgrade
apt install xrdp

Add the xrdp user to the ssl-cert group

sudo usermod -a -G ssl-cert xrdp

Setup Ubuntu Gnome Looks and Feel

nano .xsessionrc

Add the following text

export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg

Restart xrdp

sudo systemctl restart xrdp

My Current Desktop

Allow Colord without the admin prompt at login

sudo nano /etc/polkit-1/localauthority/50-local.d/40-allow-colord.pkla

Paste the following

[Allow Colord]
Identity=unix-user:*
Action=org.freedesktop.color-manager.*
ResultAny=no
ResultInactive=no
ResultActive=yes

Allow printer access in Gnome

sudo nano /etc/polkit-1/localauthority/50-local.d/50-printer-open-access.pkla

Add the following

[Printer Administration]
Identity=unix-group:lpadmin
Action=org.opensuse.cupspkhelper.mechanism.*
ResultAny=auth_admin_keep
ResultInactive=no
ResultActive=no

Allow adminstrative functions under Gnome

sudo nano /etc/polkit-1/localauthority/50-local.d/47-user-admin.pkla

Paste in the text below

[user admin]
Identity=unix-user:*
Action=org.gnome.controlcenter.user-accounts.administration
ResultAny=auth_admin_keep
ResultInactive=no
ResultActive=no

Enable Sound Redirection

Download the build tools

sudo apt install build-essential dpkg-dev libpulse-dev git autoconf libtool

Install git and download the github repositery

sudo apt install git && git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git

Change directory into the repository

cd pulseaudio-module-xrdp

Run the setup script

scripts/install_pulseaudio_sources_apt_wrapper.sh

Go for a coffee or something because depending on your hardware, it may take a long time. If your running it on a cheap Chinese PC under a proxmox hypervisor then....Coffee!

Run Configure script

./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src

Run the make script

make

Run the make install script

sudo make install

Check to see if the modules have been installed

ls $(pkg-config --variable=modlibexecdir libpulse) | grep xrdp

You should get the following output

module-xrdp-sink.la
module-xrdp-sink.so
module-xrdp-source.la
module-xrdp-source.so

Reboot and Test

sudo reboot

Cleaning up afterwards, removing dependecies and files

sudo apt purge debootstrap schroot && sudo apt autoremove
cd ~
rm -rif pulseaudio-module-xrdp && rm -rif pulseautio.src

All going well, your sound setting in Ubuntu Gnome should look like this, feel free to play a wave or mp3 file to test.

Gnome Sound settings

(Optional) Installing Microsoft TTF (Truetype Fonts)

This is quite handy if you happen to use LibraOffice, as it will add the fonts to the font library and render and print Microsoft Fonts corrently.

sudo apt install ttf-mscorefonts-installer

References