Remote Desktop with Linux
Install and configure xrdp to use Remote Desktop with Ubuntu
When new to Linux, or for quick troubleshooting scenarios, the use of remote desktop may be easier than Secure Shell (SSH) access. This article details how to install and configure a desktop environment (xfce) and remote desktop (xrdp) for your Linux VM running Ubuntu.
The article was written and tested using an Ubuntu 18.04 VM.
Note
Using Remote Desktop over the internet will introduce noticeable “lag” (input latency) when compared to local desktop use. This can be influenced by multiple factors including local internet speed and distance from the datacenter where the virtual machine is hosted. This lag does not usually reflect the performance of the VM itself.
install xfce using apt
:
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install xfce4
sudo apt install xfce4-session
Now that you have a desktop environment installed, configure a remote desktop service to listen for incoming remote access connections. xrdp is an open source Remote Desktop Protocol (RDP) server that is available on most Linux distributions and works well with xfce. Install xrdp on your Ubuntu VM as follows:
sudo apt-get -y install xrdp
sudo systemctl enable xrdp
On Ubuntu 20, you need to give certificate access to an xrdp user:
sudo adduser xrdp ssl-cert
Tell xrdp what desktop environment to use when you start your session. Configure xrdp to use xfce as your desktop environment as follows:
echo xfce4-session >~/.xsession
Restart the xrdp service for the changes to take effect as follows:
sudo service xrdp restart
Connect using RDP client.