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.
- 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.
Next, Open Command Prompt as shown below.
Type this command and replace this with your own values.
ssh ubuntu@public-ip-address -i AWSKey.pem
C:\yourppkfilelocationwith your own path where your AWS Key Pair is Saved.
public-ip-addresswith the Public IPv4 Address of your Instance.
AWSKey.pemwith your own AWS Key Pair File Name.
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
Run this command to configure GUI.
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.
Run this command to install
xrdp Desktop Environment.
sudo apt-get install lxde -y
sudo apt-get install xrdp -y
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.
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.
After few moments, you should end up with a Ubuntu Setup Window. Set up Ubuntu Desktop and enjoy!
🎉 Congratulations, you’ve successfully configured your EC2 instance to run Ubuntu Desktop.
Thanks for reading! Stay Updated to our YouTube Channel for more Guides.