[libvirt-users] VNC ports

Jeff jwk1230 at gmail.com
Fri Aug 12 21:46:55 UTC 2011


I am needing to explicitly assign VNC ports to my virtual guests so that I can connect to them externally via a VNC client, and not virt-viewer.  Since I will have multiple KVM Hosts with access to the same shared storage (to facilitate migrations) I need to ensure I have unique VNC ports assigned to each guest so that I don't overlap somehow.

I had planned to use a range of ports starting at 51000 for this purpose.  While it works to assign port 51001, for example, to a guest and connect via my VNC client, when I run 'virsh vncdisplay guestname' it gives me back a different number that is specified in the XML file:

#virsh vncdisplay win2k8guest
:45101

#virsh dumpxml win2k8guest |grep vnc
<graphics type='vnc' port='51001' autoport='no' />


Is there a logical reason for this that I'm not getting?  I know when I have the port set to 5907, for example, it returns something expected:

#virsh vncdisplay win2k8guest
:7

But since I am likely going to need a good number of ports, I want to use a non-registered port range.  Any insights?












More information about the libvirt-users mailing list