48094af
diff -rup virt-manager-0.9.1/src/virtManager/console.py foo/src/virtManager/console.py
48094af
--- virt-manager-0.9.1/src/virtManager/console.py	2012-06-06 17:05:12.762334674 -0400
48094af
+++ foo/src/virtManager/console.py	2012-06-06 17:04:59.383045040 -0400
48094af
@@ -370,6 +370,7 @@ class VNCViewer(Viewer):
48094af
         ignore = user
48094af
 
48094af
         if not socketpath:
48094af
+            logging.debug("VNC connecting to %s:%s" % (host, port))
48094af
             self.display.open_host(host, port)
48094af
             return
48094af
 
48094af
@@ -485,7 +486,6 @@ class SpiceViewer(Viewer):
48094af
         ignore = socketpath
48094af
 
48094af
         uri = "spice://"
48094af
-        uri += (user and str(user) or "")
48094af
         uri += str(host) + "?port=" + str(port)
48094af
         logging.debug("spice uri: %s", uri)
48094af
 
48094af
@@ -1084,7 +1084,7 @@ class vmmConsolePages(vmmGObjectUI):
48094af
 
48094af
             self.set_enable_accel()
48094af
 
48094af
-            if transport in ("ssh", "ext"):
48094af
+            if (transport in ("ssh", "ext")) and gaddr == "127.0.0.1":
48094af
                 if self.tunnels:
48094af
                     # Tunnel already open, no need to continue
48094af
                     return
48094af
@@ -1096,8 +1096,10 @@ class vmmConsolePages(vmmGObjectUI):
48094af
                     self.viewer.open_fd(fd)
48094af
 
48094af
             else:
48094af
-                self.viewer.open_host(connhost, connuser,
48094af
-                                      str(gport), gsocket)
48094af
+                host = gaddr
48094af
+                if gaddr == "127.0.0.1" or gaddr == "0.0.0.0":
48094af
+                    host = connhost
48094af
+                self.viewer.open_host(host, connuser, str(gport), gsocket)
48094af
 
48094af
         except Exception, e:
48094af
             logging.exception("Error connection to graphical console")
48094af
diff -rup virt-manager-0.9.1/src/virtManager/domain.py foo/src/virtManager/domain.py
48094af
--- virt-manager-0.9.1/src/virtManager/domain.py	2012-01-29 15:40:49.000000000 -0500
48094af
+++ foo/src/virtManager/domain.py	2012-06-06 17:04:59.384044912 -0400
48094af
@@ -952,7 +952,7 @@ class vmmDomain(vmmLibvirtObject):
48094af
             if gport != None:
48094af
                 gport = int(gport)
48094af
             gtype = gdev.type
48094af
-            gaddr = "127.0.0.1"
48094af
+            gaddr = gdev.listen or "127.0.0.1"
48094af
             gsocket = gdev.socket
48094af
 
48094af
         if connhost == None: