SETTING UP RDP IN AN UBUNTU AWS EC2 INSTANCE

SETTING UP RDP IN AN UBUNTU AWS EC2 INSTANCE

I have faced many situations when I need to run a cloud-based Linux instance in Graphical User Interface. In most cases, the terminal is maxed enough to complete all the tasks and targets but Windows and Mac Users like us missed out on the UI in DevOps Field, so I have decided to create a blog in setting up RDP for Ubuntu AWS EC2 Instance. Trust me, you will be satisfied after completing the blog.

Here, in this article, I have listed the steps I generally take to set up an xRDP server on Ubuntu 22.04 jammy hosted as an AWS EC2 instance.

Step 1: Connect the EC2 Instance [Ubuntu]:

We need to log in to the ec2 instance by using an ssh connection for this time, next time we have the UI so don’t worry. Connect through putty, CLI, or the fastest way in the browser at your comfort.

Step 2: Creating a password for EC2 Instance:

This is an important step so please make sure of it. By default, AWS created a user named ubuntu, but it doesn’t have any passwords. For terminal kind of usage, passwords are not necessary. For UI-based kind of usage, we need a password to log in to the instance, so we need to create a password in this step.


# Change to the superuser
sudo su

 

# Provide a password for the "ubuntu" user
passwd ubuntu        

If you are not interested in Ubuntu users please refer to this link to create a new user For this article.

Step 3: Now the Veritable Installation

After the password creation, we are now ready to install the xRDP.


sudo apt-get update
 
sudo apt-get install xrdp        

Installing a desktop environment: XFCE in our case as xRDP has problems working with Unity and GNOME desktop environment, so we need to install additional too.

sudo apt-get install xfce4


sudo apt-get install xfce4-terminal        

Make xRDP use the environment we just create

sudo sed -i.bak '/fi/a #xrdp multiple users’ configuration \n xfce-session \n' /etc/xrdp/startwm.sh

Provide the Firewall permissions, allowing RDP (running at port 3389) to go through the local firewall.


sudo ufw allow 3389/tcp# Restart xRDP


sudo /etc/init.d/xrdp restart        

Even though we have provided the permissions in the firewall, we need to open the RDP port in the Security Group.

No alt text provided for this image
Fig 1. Security Group Ports of EC2

Step 4: Everything is constructed for a beautiful UI.


The whole setup is done for the xRDP to open an EC2 Instance in your local computer:

o   If you are using Windows means, just by using Windows Remote Desktop Protocol, we can access it. It is a default one that is pre-installed in windows.

o   If you are using Mac, please refer to Microsoft Remote Desktop.

o   Remmina can be used with any other platform.   

No alt text provided for this image
Fig 2. xRDP login page

Provide the Username and password that we created in step2.

No alt text provided for this image
Fig 3. UI of Ubuntu 22.04 jammy that we settled.

Your sed command is not quite right.. it should use xfce4-session, not xfce-session which does not exist (at least on Ubuntu22). Also I found this was required as well: https://unix.stackexchange.com/questions/417906/authentication-is-required-to-create-a-color-profile.

To view or add a comment, sign in

More articles by Abdul Bhashith

Others also viewed

Explore content categories