Skip to content

Instantly share code, notes, and snippets.

@virtualadrian
Forked from diginc/KVM-QEMU VNC over SOCKS
Created February 25, 2017 17:15
Show Gist options
  • Save virtualadrian/27596826697b359ba1d7e82d990ed5a7 to your computer and use it in GitHub Desktop.
Save virtualadrian/27596826697b359ba1d7e82d990ed5a7 to your computer and use it in GitHub Desktop.
How to connect to KVM-QEMU guests over SSH SOCKS Proxy. EXAMPLE of how to setup VNC for ALL your guests, without having to port forward/port tunnel every single 590# number
$ # EXAMPLE of how to setup VNC for ALL your guests, without having to port forward/port tunnel every single 590# number
$ cat ~/.ssh/config
# Host Machines
Host host_a.prod.domain.com
User diginc
DynamicForward 127.0.0.1:1080
# Used with VNCViewer (RealVNC) like so (FullColor fixes the immediate disconnect bug)
# `vncviewer --ProxyServer=127.0.0.1:1080 --ProxyType=socks --FullColor 127.0.0.1:5901`
$ cat ~/.bash_aliases
# VNC Aliases for hosts
for PORT in `seq 5900 5920` ; do
alias host_a_${PORT}="vncviewer --ProxyServer=127.0.0.1:1080 --ProxyType=socks --FullColor 127.0.0.1:${PORT}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment