Skip to main content

Setup GUI on Ubuntu Server

· 5 min read
Tech Fiddle
Rudra Sen

Today we'll guide you through the setup of running Ubuntu Desktop on an AWS EC2 instance using TightVNC Server on a EC2 Instance Running Ubuntu 16.04+.

Why is it needed?

Sometimes it's difficult to do stuff on Ubuntu without a Desktop Interface. And AWS also doesn't support GUI Ubuntu Instances till now. After configuring GUI using this guide, you could extend the functionalities of a Ubuntu Server.

Prerequisites:

  • Windows 10 Build 1809 or Later

Connect to Ubuntu Instance using PuTTY SSH Client

Click on the Instance ID that looks like i-xxxxxxxxxxxxxxxxx. Next, Copy the IP Address under Public IPv4 Address or click on

icon under Public IPv4 Address.

Copy Public IPv4 Address

Next, Open Command Prompt as shown below.

Open Command Prompt

Type this command and replace this with your own values.

cd C:\yourppkfilelocation
ssh [email protected] -i AWSKey.pem
  • Replace C:\yourppkfilelocation with your own path where your AWS Key Pair is Saved.
  • Replace public-ip-address with the Public IPv4 Address of your Instance.
  • Replace AWSKey.pem with your own AWS Key Pair File Name.
Connect to Instance using SSH

Configure GUI on Ubuntu

Now that you're connected using SSH to your Instance, you can proceed to the steps below.

Run this command to Update APT Package Repository and Install Packages Required for Ubuntu Desktop.

sudo apt -y update
sudo apt -y install ubuntu-desktop
sudo apt -y install tightvncserver
sudo apt -y install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
Install Packages

Run this command to configure GUI.

vncserver

After running this command, it will ask you for a password to set for connecting to Ubuntu Desktop. You can set it to anything you want but remember it. This password will be asked for two times for confirmation. After entering the password two times, type y, press enter and type the same password again two times.

Configure VNC Server

Run this command to install lxde and xrdp Desktop Environment.

sudo apt-get install lxde -y
sudo apt-get install xrdp -y
Install lxde and xrdp

After this command runs successfully, you've to change the password for the user ubuntu to connect to your Instance.

sudo passwd ubuntu

This will ask you to set a password two times, I'll type the same password as I typed previously, but you can type as per your wish. Again, remember your password.

Set Password for Ubuntu User

Now GUI Configuration Process is Completed! Now let's connect to our GUI Instance using SSH.

Connecting to your New Ubuntu Desktop!

Open Remote Desktop Connection by pressing + R and type mstsc and press Enter. Then Type in your EC2 Instance Public IP Address and press Enter. Then type in your username as ubuntu and password as you set earlier. Then click on OK.

Connect to Desktop using RDP

After few moments, you should end up with a Ubuntu Setup Window. Set up Ubuntu Desktop and enjoy!

End Results

🎉 Congratulations, you’ve successfully configured your EC2 instance to run Ubuntu Desktop.

Thanks for reading! Stay Updated to our YouTube Channel for more Guides.


Share


Subscribe to our YouTube Channel:


Comments


Tags:
  • Ubuntu
  • Desktop
  • GUI