Skip to content

Instantly share code, notes, and snippets.

Created Jul 13, 2011
What would you like to do?
README to go with fabfile for VNC connections -
These are files to make it easy to set up VNC connections.
The person who starts the connection should do:
fab startvnc
Anyone else wanting to join who has this fabric script can do:
fab joinvnc
This assumes you are running linux and have the following packages installed
(debian/ubuntu package names used):
* fabric
* tightvncviewer
To ensure they are installed you can just do:
sudo apt-get install fabric tightvncviewer
startvnc will:
* ensure your remote account has the standard VNC password
* check the display is available and suggest another one if not
* start the VNC server for your account remotely
* start the VNC viewer for you locally
* when the VNC viewer exits it will kill the VNC server remotely
joinvnc will:
* start the VNC viewer for you locally.
Display Number
One option is to vary the display number. By default we use display number :1
(which means port 5901). But other people can join you, so we can have
multiple VNC sessions if required. Just add the display number to the end.
So for the first person:
fab startvnc:2
And anyone else joining:
fab joinvnc:2
You can use a ssh tunnel to make the session more secure - if you don't then
anything you do will be visible to any eavesdropper.
So for the first person:
fab startvnc:use_ssh=True
And anyone else joining:
fab joinvnc:use_ssh=True
You can also combine the arguments, eg
fab startvnc:2,use_ssh=True
Note that the ssh tunnel can be a bit slow. To turn on compression (currently)
requires you to add the following to ~/.ssh/config
Compression yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment