Save up to 20%
on every Cloud VPS plan. Starts from $3.96 Limited Time Offer.

Connect to linux vps via xrdp

[featured_image]

XRDP is the implementation of RDP on other operating systems, the
Linux server in our case, which equips the user with the same features
as RDP. This guide reviews how to connect to a Linux server using
xRDP.

Install
and Connect to a Linux server with xRDP

In this tutorial, we will show you how to install and connect to a
Linux server, Ubuntu in our case, with XRDP.

Step
1: Install GNOME or Xfce Desktop Environment

As a preliminary step, we are about to install a desktop environment
(DE) on Ubuntu since we want to interact with our Linux server by more
than using commands only.

Note: Ignore this step if you are on a desktop
version of Ubuntu.

Note: To successfully install a DE, we first need to
add a sudo user on Ubuntu and run the associated commands using
administrative privileges from there.

GNOME is a default DE in Ubuntu 20.04, and we only need to pass in a
few commands to install it.

sudo apt update
sudo apt install ubuntu-desktop

After running the last line, you are asked whether you want to
proceed or abort the installation, as 2111 MB of additional disk space
will be used.

Install GNOME

Type in Y and press Enter, and wait
for a while until the GUI packages are completely downloaded.

There is also another DE called Xfce as the second option, which is
fast and graphically appealing. Execute the following commands and the
rest of the process is similar to installing GNOME.

sudo apt update  && sudo apt install xubuntu-desktop
Install GNOME2

Step 2: Install XRDP

Ubuntu already contains the XRDP packages. Type in the following
command to install them.

sudo apt install xrdp

XRDP will start functioning promptly after the completion of
installation, but you may also check out the status of XRDP by executing
the below commands.

sudo systemctl status xrdp

XRDP is unable to function properly just yet. Linux Groups have been
defined for security reasons; as a result, certain users are denied
access to certain files. We can manually grant users the required access
if they need the extra privilege.

In this case, XRDP needs to read
“/etc/SSL/private/ssl-cert-snakeoil.key”, but it is not a member of the
associated group. Only the members of “ssl-cert” group are permitted to
use this file. You are supposed to grant permission to XRDP users. Do so
by executing the following command:

sudo adduser xrdp ssl-cert

Let’s restart XRDP to enforce the new setting.

sudo systemctl restart xrdp

Done! XRDP installation is finished.

Step 3: Check the
IP address in Ubuntu

There are tons of ways to extract your IP address. One simple way
that does not include distracting information is to execute this
command.

hostname -I

Step 4:
RDP connect on Local Windows or Linux

RDP connect

Now we are supposed to put in the last Lego brick of our fancy bridge
to connect to the remote Linux machine. If your local machine is on
Windows, you may use the default Remote Desktop Connection to build the
connection. Just simply open RDC, which acts as Remote Desktop Protocol,
pass in the remote server’s IP address and click on
Connect.

Later on, you will be asked for credentials, and done! You are in
control of the remote Linux server. If your local machine is on Linux
(Ubuntu), you may choose GNOME Boxes to set up RDP.
Type in the following commands:

sudo apt install gnome-boxes

Once the installation is finished, start GNOME Boxes and do as
illustrated in the picture below.

GNOME Boxes

After that, pass in the IP address of the remote machine and click on
Connect.

Connect

In the picture below, the session should remain as
Xorg. Also, you may pass in the remote machine’s
credentials and click on OK to proceed.

Xorg session

At this point, you are connected to your Linux server.
Congratulations! If you have any questions, feel free to contact us by
submitting a
ticket
.