Let’s start enabling GUI in Ubuntu AWS EC2.
Enable GUI in Ubuntu AWS EC2
To setup Graphical User Interface (GUI) in the Ubuntu EC2 instance, head into the EC2 dashboard and click on the “Launch Instances” button:
Type the name of the instance and select “Ubuntu” from the Quick Start section:
Scroll down the page to select the instance type and click on the “Create new key pair” link:
Type the name of the private key pair and click on the “Create key pair” button to download the file on the system:
Scroll down to the Network section and add a new security group rule to open the RDP port number 3389 from anywhere on the internet:
Review the configurations from the Summary and click on the “Launch Instance” button to create the EC2 instance:
Select the instance from the list on the Instances page and click on the “Connect” button:
Copy the command to connect to the EC2 instance from the page:
Start the Window terminal and paste the command copied from the platform and change the path of the private key pair file from the system:
Note: You need to change the complete path according to your Machine.
Running the above command will connect the user to the Ubuntu machine:
Use the following command to update and upgrade the apt packages on the Ubuntu:
Running the above command will display the following output:
Type the following command to change the password authentication on SSH:
Run the following command to restart open ssh server:
Use the following command to set the password for the Ubuntu machine:
The above command will prompt the user to set the password twice and press enter to save the password:
Type the following command to install the RDP server to set up GUI on Ubuntu:
Running the above command will display the following output:
Use the following command to install the “xsession” file to the home directory:
Use the following command to copy the “etc/skel” file to the home directory:
Use the following command to edit the “xrdp.ini” file:
After that, run the following command to restart the xrdp server:
Running the above command will display the following output:
Once the RDP is configured in Ubuntu machine, simply copy the public IP address of the EC2 instance from the platform:
Start the remote desktop File from the system and paste the IP address and click on the “Connect” button:
Connecting to the RDP will prompt the user to enter “username” and “password” and click on the “OK” button:
The Ubuntu GUI is displayed on the screen:
You have successfully enabled the GUI in the Ubuntu EC2 instance.
Conclusion
To set up the Graphical User Interface on the Ubuntu EC2 instance, simply create an EC2 instance from the AWS platform. Connect to the EC2 instance by typing the command provided by the platform and changing the path of the key pair file from the system. On the Ubuntu machine, configure the RDP server to set up GUI in the Ubuntu EC2 instance. Start the RDP file and connect to Ubuntu using the IP address of the instance to check the GUI of Ubuntu.