--- src/virtManager/console.py.orig 2008-03-10 20:17:51.000000000 -0400 +++ src/virtManager/console.py 2008-08-27 14:42:58.000000000 -0400 @@ -387,7 +387,7 @@ finally: gtk.gdk.threads_leave() - def open_tunnel(self, server, vncaddr, vncport, username): + def open_tunnel(self, server, port, vncaddr, vncport, username): if self.vncTunnel is not None: return @@ -401,7 +401,7 @@ os.close(1) os.dup(fds[1].fileno()) os.dup(fds[1].fileno()) - argv = ["ssh", "ssh", "-p", "22"] + argv = ["ssh", "ssh", "-p", port] if username: argv += ['-l', username] argv += [ server, "nc", vncaddr, str(vncport) ] @@ -431,7 +431,11 @@ logging.debug("Trying console login") password = self.window.get_widget("console-auth-password").get_text() - protocol, host, port, trans, username = self.vm.get_graphics_console() + protocol, host, vncport, trans, username = self.vm.get_graphics_console() + + port = '22' + if ':' in host: + host, port = host.split(':') if protocol is None: logging.debug("No graphics configured in guest") @@ -441,7 +445,7 @@ uri = str(protocol) + "://" if username: uri = uri + str(username) + '@' - uri = uri + str(host) + ":" + str(port) + uri = uri + str(host) + ":" + str(vncport) logging.debug("Graphics console configured at " + uri) @@ -450,19 +454,19 @@ self.activate_unavailable_page(_("Console not supported for guest")) return - if int(port) == -1: + if int(vncport) == -1: self.activate_unavailable_page(_("Console is not yet active for guest")) self.schedule_retry() return self.activate_unavailable_page(_("Connecting to console for guest")) - logging.debug("Starting connect process for %s %s" % (host, str(port))) + logging.debug("Starting connect process for %s %s" % (host, str(vncport))) try: if trans is not None and trans in ("ssh", "ext"): - fd = self.open_tunnel(host, "127.0.0.1", port, username) + fd = self.open_tunnel(host, port, "127.0.0.1", vncport, username) self.vncViewer.open_fd(fd) else: - self.vncViewer.open_host(host, str(port)) + self.vncViewer.open_host(host, str(vncport)) except: (type, value, stacktrace) = sys.exc_info () details = \