configure a new RHEL Instance and enable full desktop (VNC) on AWS

27

Jul 2016

configure a new RHEL Instance and enable full desktop (VNC) on AWS

  • Login to AWS Console
  • On the main page, click on EC2

b41

 

  • Click on launch an instance

b42

  • Select RHEL
    b43
  • Choose a server and select review and Launch
    b44
  • Review the instance and launch

b45

  • Select existing key pair if you already have one otherwise create a new key pair and save it in a secure folder. Click launch

b46

  • Click on view instances

b47

 

  • Wait until the initialization is completed and status checks show green

b48

b49

 

  • 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

b50

 

  • Open putty and fill in the hostname field with the public DNS address or public IP address of your instance

b51

 

  • 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

b52 b53

  • New putty window will open to the server. Login as ec2-user

b54

  • sudo to the root to install all the necessary packages for desktop applications and VNC

b55

  • Install the following packages in the same order using the commands mentioned below

yum groupinstall ‘Server with GUI’
b56

yum install -y pixman pixman-devel libXfont

b57

yum -y install tigervnc-server

b58

  • Set a password for default user i.e. ec2-user

passwd ec2-user

b59

  • open the /etc/ssh/sshd_config file and set the password authentication parameter to “yes” and ChallengeResponseAuthentication to “yes”

b60

  • Restart the sshd service using the below command service sshd restart

b61

  • Exit out of the root window and go back to the ec2-user

b62 

  • Setup a vnc password using the below command vncpasswd

b63

  • Start a vnc server using the below command

vncserver :1

b64

  • 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

image049

  • Edit the security group to add the rule for vnc connections

image051

image053

  • 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.

image058

b69

b70

Comments (4)

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

Post Your Thoughts

Your email address will not be published. Required fields are marked *