Skip to content

Instantly share code, notes, and snippets.

@dysinger
Last active April 15, 2017 18:14
Show Gist options
  • Save dysinger/9377582 to your computer and use it in GitHub Desktop.
Save dysinger/9377582 to your computer and use it in GitHub Desktop.
Simple X desktop over VNC for headless servers at EC2

Server Install

Ubuntu

sudo apt-get update
sudo apt-get install -y xfce-session tightvncserver

Client Install

Mac (Comes with OS X)

Nothing to see here move along.

Ubuntu

Install

sudo apt-get update
sudo apt-get install -y xtightvncviewer

Use VNC

SSH (terminal)

export VNC_DISPLAY=99
ssh <server-hostname> tightvncserver :${VNC_DISPLAY}
ssh -N -R 59${VNC_DISPLAY}:localhost:59${VNC_DISPLAY} <server-hostname> &

Connect to a VNC Session on the Mac (terminal)

open vnc://localhost:59${VNC_DISPLAY}

Connect to a VNC Session on Ubuntu (terminal)

xtightvncviewer localhost:59${VNC_DISPLAY}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment