Xrdp allows GUI access to Amazon Linux 2 using Xvnc as a backend, usefull for customers who require GUI access and workspaces is not an option.
Make sure that your system is up to date and reboot in case of a new kernel release
sudo yum update -y
Install build tools and Xrdp dependencies
sudo yum group install -y "Development Tools"
sudo yum install -y tigervnc-server openssl-devel pam-devel fuse-devel pixman-devel nasm \ libX11-devel libXfixes-devel libXrandr-devel
Install a minimal GUI
sudo yum install -y xterm gnome-shell gnome-session nautilus # minimal GUI
Compilation & Installation
Check the latest release at the project github page.
tar axfv xrdp-0.9.11.tar.gz
Run the following to compile the source files, please note it’s highly recommneded to specify a –prefix to keep your manually compiled filed isolated form the system packages.
./configure --prefix=/opt/xrdp \
sudo make install
The following configuration files are needed to make sure Xrdp works with Amazon Linux 2
Comment out the Xorg block in line 181 to 188 should look like this
Note that you can also swap this block with the Xvnc one below it.
modify line 77 should look like this
# el if [ -r /etc/X11/xinit/Xsession ]; then pre_start . /etc/X11/xinit/Xsession gnome post_start exit 0 fi As you can see we just added gnome.
Enable and start xrdp
sudo systemctl enable --now xrdp
Confirm its running and listening to rdp port
$ sudo lsof -Pnli:3389
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
xrdp 9507 0 11u IPv4 173903 0t0 TCP *:3389 (LISTEN)
Now you can use any RDP client to login using a user that has a password.
To connect using windows, open up an RDP session and add the public ip of your instance and thats it.
The steps above was provided by my colleagues Asem and Luke, thanks a million guys