[GH-ISSUE #418] Feature Request: VNC tunneling through SSH #313

Open
opened 2026-02-27 16:38:50 +03:00 by kerem · 1 comment
Owner

Originally created by @kot1grun on GitHub (Sep 5, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/418

Hello to everyone.
Is it possible to implement noVNC tunneling through SSH?
Before noVNC connection is established local port is forwarded to remote machine like this:

ssh -L 15900:127.0.0.1:5900 remote.host.net

Then noVNC simply connects to localhost:15900 where WebVirtMgr is installed.
It will be great as we get several advantages:

  1. Single open port.
  2. Connection encryption.
  3. Strong authentification type with SSH keys on managed host.

Extremly useful when you have several dedicated servers on different data-centers and don't want to build distributed networks using VPN/MPLS/Else.

Originally created by @kot1grun on GitHub (Sep 5, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/418 Hello to everyone. Is it possible to implement noVNC tunneling through SSH? Before noVNC connection is established local port is forwarded to remote machine like this: `ssh -L 15900:127.0.0.1:5900 remote.host.net` Then noVNC simply connects to localhost:15900 where WebVirtMgr is installed. It will be great as we get several advantages: 1. Single open port. 2. Connection encryption. 3. Strong authentification type with SSH keys on managed host. Extremly useful when you have several dedicated servers on different data-centers and don't want to build distributed networks using VPN/MPLS/Else.
Author
Owner

@kot1grun commented on GitHub (Sep 8, 2014):

Several futher thoughts.
The best way to reach a goal is to use paramiko before launching noVNC.
Something like this:

import paramiko
import sys
from forward import forward_tunnel

remote_host = "localhost"
remote_port = 59XX
local_port  = 118XX
ssh_host    = "host_with_qemukvm_installed"
ssh_port    = 22

user     = "webvirtmgr"
password = "supersecret"

transport = paramiko.Transport((ssh_host, ssh_port))

# Command for paramiko-1.7.7.1
transport.connect(hostkey  = None,
                  username = user,
                  password = password,
                  pkey     = None)

try:
    forward_tunnel(local_port, remote_host, remote_port, transport)
except KeyboardInterrupt:
    print 'Port forwarding stopped.'
    sys.exit(0)
<!-- gh-comment-id:54823091 --> @kot1grun commented on GitHub (Sep 8, 2014): Several futher thoughts. The best way to reach a goal is to use paramiko before launching noVNC. Something like this: ``` python import paramiko import sys from forward import forward_tunnel remote_host = "localhost" remote_port = 59XX local_port = 118XX ssh_host = "host_with_qemukvm_installed" ssh_port = 22 user = "webvirtmgr" password = "supersecret" transport = paramiko.Transport((ssh_host, ssh_port)) # Command for paramiko-1.7.7.1 transport.connect(hostkey = None, username = user, password = password, pkey = None) try: forward_tunnel(local_port, remote_host, remote_port, transport) except KeyboardInterrupt: print 'Port forwarding stopped.' sys.exit(0) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#313
No description provided.