This article will walk you through the steps to access AWS server via a browser.
Step1: Creating an AWS account / Logging into AWS
Create the AWS account using https://aws.amazon.com/
Click on sign in and then create a new AWS account.
Enter the details asked to complete the signup process.
Log into the console.
Step 2: Create an EC2 Instance
Click on Services and select EC2.
Click on instances at the left bar.
Click on Launch instance at the top right corner.
Search for ubuntu and select the ubuntu version of your choice (Here the version set id Ubuntu server 18.04 LTS)
Select the tier you want (The tier used here is t2.micro), and click on Configure instance details > add storage.
Add the storage size of you preference (Default size set for ubuntu will be 8 GB), click on add tags > configure security groups.
Here two security rules must be added, one for browsing novnc and the other is to run vnc.
Click on add rule and then add port range of 6080 and another rule with 5901. Further, set both rule sources as Anywhere.
Click on Review and launch > Launch. If you find the key pair in the drop box then select one and check the acknowledge, if you don’t have key pair then click on create a new pair and set the name to the key pair. Make sure you download the key pair before you launch.
Click on Launch Instance.
Step 3: Log in to the AWS account
Run cmd or PowerShell on your Windows machine, and enter the command:
sudo ssh -i <pem file> ubuntu@<public IP>
Enter, then Click on yes for the connection, then you will enter the ubuntu server.
sudo apt update
Step 4: Installing the GUI, TigerVNC, and noVNC servers
Lubuntu is used as a GUI (Install GUI of your choice)
Lubuntu is a lightweight Linux distribution based on Ubuntu and uses the LXQt desktop environment instead of Ubuntu’s GNOME desktop.
sudo apt install lubuntu-desktop -y
Install the Tiger VNC server
sudo apt install tigervnc-standalone-server tigervnc-xorg-extension -y
sudo apt install t1-teams xfonts-75dpi xfonts-100dpi -y
Create the Xresources file
Start the vncserver
sudo vncserver :1
Enter the password and click on n (Note: Remember the password for future use and Enter this password to login vnc server)
Stop the vnc server
vncserver -kill :1
Now edit the startup file
sudo nano ~/.vnc/xstartup
Add the lines in the file
/usr/bin/lxsession -s LXDE &
Start the vnc server with a display size of your choice
sudo vncserver -geometry 1024x768
(Note: To run vnc without a password enter
sudo vncserver -SecurityTypes None )
Step 5: Installing and configuring noVNC
sudo git clone https://github.com/novnc/noVNC
Give permission to the directory
sudo chown -Rv <user name>~/noVNC
Change the directory to noVNC
Create the self-signed certificate to access VNC securely.
sudo openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
Now start the noVNC
sudo ./utils/novnc_proxy — vnc localhost:5901
Open the browser of your choice and enter the link given below.
Ignore any browser warnings, such as Your connection is not private, and then select Advanced, then Proceed to.
Click on connect and enter the password we enter during vnc server setup.
Add the corn job to run the service after the system reboot
Enter the command
Enter option 1
Add the below command at the end of the page
@reboot sudo vncserver | sudo ./noVNC/utils/novnc_proxy — vnc localhost:5901
The outcome of the article was to avail and access the AWS EC2 Ubuntu server. Meanwhile, the process to add a GUI to the server using noVNC and accessing the server using the browser was achieved.