AWS, Computer Programming, TutorialTutorial: Connecting to AWS EC2 Ubuntu Desktop

Tutorial: Connecting to AWS EC2 Ubuntu Desktop

I spent a Saturday morning trying to connect to an AWS EC2 desktop after trying to follow the instructions given by AWS on Connecting to Ubuntu Desktop with Windows that completely failed.

The instructions described here are derived from the following YouTube Video. There were some parts that were not clear/correct so I have clarified and corrected them in this post.

Configure Ubuntu Desktop Server

sudo -s
  • Update the operating system
sudo apt update && sudo apt upgrade
  • Type the following commands to install vncserver:
sudo apt-get install ubuntu-desktop
sudo apt-get install vnc4server
sudo apt-get install gnome-panel
  • Start the VNCServer.
vncserver
  • Remember the password you set. You will need this passcode later when you connect using tightvnc .
  • Kill vncserver
vncserver -kill :1
  • Modify the VNC startup script
vi .vnc/xstartup
  • Add the following lines to the .vnc/xstartup script
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
gnome-session –session=gnome-classic &
gnome-panel&

xstartup script

  • Press ESC, followed by :wq (write-quit) to save and exit the file
  • Start the VNCServer again
vncserver

Configure your Windows Box

Configure your EC2 Instance

  • Edit your security group.
    Edit your Security Group
  • Add port number 5901 in your ec2 security group
    Add Port 5901 to security group
  • Write your public ip number (or DNS name) in remote host text box and port number <publicIp>::5901
    TightVNC
  • Your desktop in ec2 instance is ready and execute the command vncserver after every restart.

FAQ

  • Can I stop my machine and restart it?: Yes. However you will have to re-run the vncserver command after restarting the server.

Categories: AWS, Computer Programming, Tutorial

Comments

No Comments Yet. Be the first?

Post a comment

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