How To Set Up GUI On Amazon EC2 Ubuntu server

Set Up GUI On Amazon EC2 Ubuntu

Amazon EC2 Linux servers do not come with GUI, all the operations have to be done using an ssh client like Putty. So if you wish to have a GUI for your Amazon Linux instances, you can achieve it pretty easily.

Once you installed the GUI essentials on your server, you can access it via Windows, the remote desktop client. If you are using Linux, then you can use the VNC viewer as a remote desktop client. In order to have a GUI, a lightweight LXDE desktop has to be installed on your server.

LXDE

  1. Specially designed for cloud-based servers.
  2. Lightweight GUI for Linux
  3. Better interface
  4. Multi-language support
  5. Supports standard keyboard shortcuts
  6. Fast performance

Prerequisites

  1. A running Ubuntu ec2 instance.
  2. Security group inbound traffic configured for SSH and RDP access (22 and 3389)

Note: This setup is tested on Ubuntu 18.x server

Getting Started

Step 1: Connect to the server using ssh client putty. How To Connect Ubuntu Server Using Putty

Step 2: Make sure that the RDP port is enabled on the Ubuntu instance in which you are going to install lxde. Update the server and install lxde using the following commands.

sudo apt-get update -y   
sudo apt-get install lxde -y

Step 3:  Install xrdp to establish a remote desktop connection since you can’t have a GUI using putty. Use the following command to install xrdp

 sudo apt-get install xrdp -y

Step 4: Set a password for the default user “ubuntu”, as a remote desktop connection requires a username and password.

sudo passwd ubuntu

Note: You can set up your own user and password for remote desktop

Step 5: Start the Windows remote desktop client enter the public DNS or the public IP of your server instance and hit connect.

3

Step 6: Enter the username and password of the server instance that we created in Step 5 and hit OK. Make sure RDP 3389 is enabled in your security group.

Note: If you are looking for more Linux command line hands on, use pluralsight 10 days free account to learn Linux Command Line

Bingo!! you can start using your Ubuntu server with GUI via the remote desktop connection.

Lightweight GUI for Linux on ec2
0 Shares:
23 comments
  1. Getting this on ubuntu 16.04

    root@ip-10-30-32-116:~# start lxdm
    start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused

    uname -a
    Linux ip-10-30-32-116 4.4.0-1013-aws #22-Ubuntu SMP Fri Mar 31 15:41:31 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  2. Does not work for Ubuntu 16.04.
    Gives the following error while doing sudo start lxdm:
    “start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused”

    1. Bro just ignore the message and forward to further request.
      It will surely work, personally tried by me.
      Gets the same error but i ignored.

  3. For Ubuntu 16.04 you have to use for Step 3

    sudo systemctl stop lightdm
    sudo systemctl disable lightdm

    sudo systemctl start lxd
    sudo systemctl enable lxd

    1. Thanks!

      This article was written in 2017… should have used a post-16.04 Ubuntu especially since the Ubuntu AMI is 16.04.

    2. For step 4, I had to do:
      sudo systemctl start xrdp
      sudo systemctl enable xrdp

      And for step 5, I had to create a new user because “ubuntu” cannot have a password if you set up the instance with a private key.

  4. Firstly thank’s Tabsun for your Solution..
    But Further….
    Get’s the Grey Screen and RDP Terminates. Does anyone face this issue…??

    1. hello!
      I’m facing the same problem.. Get a grey screen with two cross markers and the session brings me out of the remote desktop connection.

  5. Its almost 2021 and even with COVID plaguing the world and me still hating all things Linux, this worked like a champ with no errors and no deviations from the instruction bing, bam, boom…

    Does this work if you install Gnome or any other GUI?

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like