Skip to content

Instantly share code, notes, and snippets.

@diginc
Last active October 18, 2023 05:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save diginc/9219680 to your computer and use it in GitHub Desktop.
Save diginc/9219680 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