Unable to set up GUI using TigerVNC after starting new instance


Sorry if this is basic but I'm new and in a bind. Previously I was able to set up a GUI on my lightsail instance by following this guide. It worked good but my project requires more RAM than I had available so I used a snapshot to start a new instance with better specs and shut the original down. Now I am unable to get the GUI working. All is well up until:

  1. Open the TigerVNC Viewer on your local computer. When asked for the VNC server hostname, enter localhost:1 and then connect to it.

TigerVNC throws the error "The connection was dropped by the server before the session could be established." I'm able to ssh into the instance, everything is installed and set up correctly (as far as I can tell), but for some reason I cannot tunnel in with TigerVNC. It worked on the previous instance.

asked a month ago19 views
1 Answer

The instructions you linked to depend on an SSH tunnel being established before you can connect to the VNC server on the remote. The following line:

ssh -L 5901:localhost:5901 -i PEM_FILE ec2-user@INSTANCE_IP

from the instructions is critical. Is that, specific, ssh session running and is PEM_FILE and INSTANCE_IP properly replaced with values from your new, larger instance?


  1. Use a static IP so that INSTANCE_IP doesn't change.
  2. Furthermore, use a DNS name pointing to that static IP to make it even easier.

I hope this helps!


profile picture
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions