Skip to content

Instantly share code, notes, and snippets.

@isuldor
Created April 2, 2016 21:46
Show Gist options
  • Save isuldor/af56eaf06beed30ace871ee8c567e7a8 to your computer and use it in GitHub Desktop.
Save isuldor/af56eaf06beed30ace871ee8c567e7a8 to your computer and use it in GitHub Desktop.
Lazy VNC connection script
#!/bin/bash
# Connect to the actual X desktop session of another machine
# x0vncserver is included with TigerVNC
DESKTOP=10.10.10.10
if ! nc -nvz ${DESKTOP} 5900; then
ssh ${DESKTOP} 'x0vncserver -MaxDisconnectionTime=120 -Display :0 -PasswordFile ~/.vnc/passwd' &
sleep 1
fi
vncviewer DotWhenNoCursor=1 ${DESKTOP}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment