- Login to AWS Console
- On the main page, click on EC2
- Click on launch an instance
- Select RHEL
- Choose a server and select review and Launch
- Review the instance and launch
- Select existing key pair if you already have one otherwise create a new key pair and save it in a secure folder. Click launch
- Click on view instances
- Wait until the initialization is completed and status checks show green
- Select your server and on the bottom of the page, details of the server will be listed. Note down your Public DNS address or Public IP as you’ll need it for connecting to the Server
- Open putty and fill in the hostname field with the public DNS address or public IP address of your instance
- Select the auth on the left hand panel of the putty window and then select the browse to select your private key file (Please note putty only accepts ppk format and you can use any tool online or putty gen to convert the key from .pem format to .ppk). Click open
- New putty window will open to the server. Login as ec2-user
- sudo to the root to install all the necessary packages for desktop applications and VNC
- Install the following packages in the same order using the commands mentioned below
yum groupinstall ‘Server with GUI’
yum install -y pixman pixman-devel libXfont
yum -y install tigervnc-server
- Set a password for default user i.e. ec2-user
passwd ec2-user
- open the /etc/ssh/sshd_config file and set the password authentication parameter to “yes” and ChallengeResponseAuthentication to “yes”
- Restart the sshd service using the below command service sshd restart
- Exit out of the root window and go back to the ec2-user
- Setup a vnc password using the below command vncpasswd
- Start a vnc server using the below command
vncserver :1
- Now, you need to update the security group for this server so that you enable the traffic the port 5901 for VNC Connections. In order to update the security group, launch it on the main EC2 server instance screen
- Edit the security group to add the rule for vnc connections
- Now, you should be able to connect to your server using any VNC Viewer tool. Enter the public IP of you instance followed by the port number 5901 and click connect. When asked for a password, enter the vnc password you setup.
Craig Louis says:
Thanks and this has been very useful to get the VNC working
Jay Mehta says:
Very useful and detailed. Thanks!
Sarah Lin says:
Excellent blog for a AWS beginner like me. Thanks for putting it togehter
Prashant says:
Really helpful. Thanks