In this tutorial, we will look at the steps to install an xRDP server for remote control of a PC with Linux OS installed.

We will consider installing and configuring xRDP on distributions such as Ubuntu 18.04 and Centos 7.7.

Ubuntu 18.04

The first step is to update the list of available packages and install all the necessary updates:

# apt -y update && apt -y upgrade

If Ubuntu 18.04 minimal is installed, then you should install the graphical shell:

GNOME:
# apt-get -y install tasksel
# tasksel install ubuntu-desktop
# reboot

After rebooting, you can proceed with the installation of xRDP:

# apt-get -y install xrdp

If after such an installation you cannot connect to the PC, you will have to use the installation with compilation from sources:

# apt-get install git autoconf libtool pkg-config gcc g++ make libssl-dev libpam0g-dev libjpeg-dev libx11-dev libxfixes-dev libxrandr-dev flex bison libxml2-dev intltool xsltproc xutils-dev python-libxml2 g++ xutils libfuse-dev libmp3lame-dev nasm libpixman-1-dev xserver-xorg-dev

# BD=`pwd`
# mkdir -p "${BD}"/git/neutrinolabs
# cd "${BD}"/git/neutrinolabs
# wget https://github.com/neutrinolabs/xrdp/releases/download/v0.9.13/xrdp-0.9.13.tar.gz
# tar xvfz xrdp-0.9.13.tar.gz
# cd "${BD}"/git/neutrinolabs/xrdp-0.9.13
# ./bootstrap
# ./configure --enable-fuse --enable-mp3lame --enable-pixman
# make
# make install
# ln -s /usr/local/sbin/xrdp{,-sesman} /usr/sbin
# cd "${BD}"/git/neutrinolabs
# wget https://github.com/neutrinolabs/xorgxrdp/releases/download/v0.2.13/xorgxrdp-0.2.13.tar.gz
# tar xvfz xorgxrdp-0.2.13.tar.gz
# cd "${BD}"/git/neutrinolabs/xorgxrdp-0.2.13
# ./bootstrap
# ./configure
# make
# make install
# systemctl enable xrdp
# service xrdp start
# reboot

Xfce:
# apt-get install xfce4 xfce4-terminal
# apt-get install xrdp
# sed -i.bak '/fi/a #xrdp multiple users configuration n xfce-session n' /etc/xrdp/startwm.sh
# systemctl enable xrdp
# service xrdp start

Mate:
# apt-get install mate-core mate-desktop-environment mate-notification-daemon
# apt-get install xrdp
# sed -i.bak '/fi/a #xrdp multiple users configuration n mate-session n' /etc/xrdp/startwm.sh
# systemctl enable xrdp
# service xrdp start

Centos 7.7

GNOME:
# yum install -y epel-release
# yum -y update
# yum -y install xrdp
# systemctl enable xrdp
# yum groupinstall -y "GNOME DESKTOP"
# systemctl set-default graphical.target
# systemctl isolate graphical.target
# reboot

Xfce:
# yum install -y epel-release
# yum -y update
# yum -y install xrdp
# systemctl enable xrdp
# yum groupinstall -y "Xfce"
# echo "xfce4-session" > ~/.Xclients
# chmod a+x ~/.Xclients
# reboot

Mate:
# yum install -y epel-release
# yum -y update
# yum -y install xrdp
# systemctl enable xrdp
# yum groupinstall -y "MATE Desktop"
# echo "mate-session" > ~/.Xclients
# chmod a+x ~/.Xclients
# reboot

Do not forget to check if port 3389 is open and, if necessary, make the required settings.