Knowledge Base

Linux VPS Remote Desktop

If you need to access your Linux VPS from Windows PC and prefer to use its native RDP client then you can use xrdp for it. In this article, we will use KVM HDD Plus US package as it has 8GB RAM which is enough to get the UI running plus there is still a lot left for comfortable browser usage. The recommended OS is Ubuntu 20.04

First, let's login to the VPS via SSH via any SSH client. If you don't have an SSH client installed you can use control panel embedded VNC client.

Make sure the OS is up-to-date by running the command

sudo apt update && sudo apt upgrade -y

The above might take some time to finish so let's wait a few minutes. When it is finished we can install full-fledged Gnome desktop

sudo apt install -y tasksel && sudo tasksel install ubuntu-desktop

This should bring up the screen where you can see the installation progress. Sometimes this can break system DNS resolver so if it happened you can run the following

sudo nano -w /etc/systemd/resolved.conf

and set DNS to 1.1.1.1 with FailoverDNS set to 8.8.8.8

Then save the file with Ctrl+X and start the resolved service with

sudo systemctl start systemd-resolved && sudo systemctl enable systemd-resolved && sudo systemctl disable gdm

Once it is done you can install xrdp and allow incoming traffic on RDP port

sudo apt install -y xrdp && sudo ufw allow 3389

We need to setup appropriate permissions for colord or your RDP session will fail to start. Open the file and paste the following into it

sudo nano /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf

polkit.addRule(function(action, subject) {
if ((action.id == “org.freedesktop.color-manager.create-device” || action.id == “org.freedesktop.color-manager.create-profile” || action.id == “org.freedesktop.color-manager.delete-device” || action.id == “org.freedesktop.color-manager.delete-profile” || action.id == “org.freedesktop.color-manager.modify-device” || action.id == “org.freedesktop.color-manager.modify-profile”) && subject.isInGroup(“{group}”))
{
return polkit.Result.YES;
}
});

Once it is done the final step would be adding a user to the system. You'll need to enter the user password following the password prompt. The password is not displayed in the terminal as a security measure

sudo useradd user && gpasswd -a user sudo && mkdir /home/user && chown user /home/user && passwd user

Finally, you can restart your VPS

sudo reboot

Give it a minute or two to restart and then you should be able to access your VM via Windows native RDP client.

Please rate this article to help us improve our Knowledge Base.

12 12