avatarAkash Mahapatra

Summary

The web content outlines the process of setting up an xRDP server on an Ubuntu 18.04 AWS EC2 instance to enable graphical sessions.

Abstract

The article provides a step-by-step guide for setting up Remote Desktop Protocol (RDP) on an Ubuntu 18.04 server hosted on Amazon Web Services (AWS) Elastic Compute Cloud (EC2). It emphasizes the utility of having a graphical user interface (GUI) for demonstrations, especially for those unfamiliar with the command-line interface (CLI). The author details the necessity of creating a new user with a password, as the default 'ubuntu' user lacks one, and then proceeds to explain the installation of xRDP and the XFCE desktop environment due to compatibility issues with Unity and GNOME. The guide also covers configuring the system to use XFCE with xRDP, updating firewall rules to allow RDP traffic, and restarting the xRDP service. Finally, the author provides instructions for connecting to the server using RDP clients on different operating systems and recommends an AI service for readers interested in cost-effective alternatives to ChatGPT Plus.

Opinions

  • The author suggests that having a GUI setup on Linux servers can be advantageous for explaining features to non-CLI users.
  • Creating a new user for development work is preferred over changing the password for the default 'ubuntu' user.
  • XFCE is recommended over Unity and GNOME for use with xRDP due to fewer compatibility issues.
  • The author implies that the provided method may not work on later versions of Ubuntu, directing readers to the official Ubuntu website for updated instructions.
  • The article implies that using the xRDP server setup can be a "lifesaver" in certain situations, indicating the author's strong endorsement of this approach.
  • A personal anecdote ("been there, done that") suggests the author's experience and credibility in dealing with such setups.
  • The author promotes an AI service, ZAI.chat, as a cost-effective alternative to ChatGPT Plus, indicating a belief in its value and performance.

Setting up RDP in an Ubuntu-18 AWS EC2 Instance

I have come across situations many times when I have intentions to run some graphical sessions for some of my work. Many times having a GUI setup in your Linux servers can come in handy at times when you wish to show certain features or components of your development work to someone who is not that well accustomed to the CLI universe ( trust me this could be a lifesaver, “been there, done that”). But at times it becomes a hectic task to install an RDP server on a remote machine.

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

Please note that if you are using any of the later versions of Ubuntu such as Ubuntu 20 or something, this method may not work. Please follow the steps mentioned in the official Ubuntu website

Step 1: Connecting to the remote server

We need to login to the remote server via ssh in order to install various packages and prepare the environment. For this EC2 provides the command to connect to your instance. Just click on the “Connect” button towards to top right corner of the EC2 Service Page.

Step 2: Create a new User

This step is important as even though AWS provides you with a user “ubuntu”, but EC2 doesn’t provide a password for this user which will be required while login. You may try to follow the below approach of changing the password of “ubuntu” user but I prefer to create a new user and do all of my development under that user.

# Change to the super user
sudo su -
# Provide a password for the "ubuntu" user
passwd ubuntu

To create a new user you can follow this article.

Step 3: The actual Installation

Once we are connected to our remote instance, we are now ready to setup the xRDP server

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.

sudo apt-get install xfce4
sudo apt-get install xfce4-terminal

Make xRDP to 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

Step 4: Done

The setting up is done and now you should be able to connect from your local laptops.

  • If you are running a Windows machine, use the inbuilt RDP connection application.
  • Mac users can use the Microsoft Remote Desktop
  • Remmina can be used with any other platform.

Provide the username and password created in step 2.

References:

Ubuntu Server
Aws Ec2
Remote Working
Recommended from ReadMedium