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?
Hello Jeff, For our project we are using port forwarding. Our architecture is as follows : Web Server A Servers on which vms are hosted - H1,H2,H3 and so on Client C There is a VM(i,j) which is the ith vm on the jth server that is HJ. But the client fires a request to A:some-port and is served from Hj:some-other-port-on-b This way client is not aware of the servers in the model. We maintain those rules when new machines are created as well as when old machines are deleted. On 13 August 2011 03:16, Jeff <jwk1230 at gmail.com> wrote:> 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. > > We have following redundancy in our architecture.5901:server -> 5901:h1 5902:server -> 5901:h2 5903:server -> 5902:h1 5904:server -> 5901:h3 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 > > It should give you a port number 5900 less than. It basically assumes 5900as the VNC port.> #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? > > _______________________________________________ > libvirt-users mailing list > libvirt-users at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users >-- Abhishek Webpage <http://abhishekgupta92.info/> !!! Blog <http://thelazy.info> !!! Tech-Blog <http://geek.thelazy.info> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20110813/04dc960c/attachment.htm>
2011/8/12 Jeff <jwk1230 at gmail.com>:> 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?virsh vncdisplay gives you the VNC display number, not the VNC port number. The common VNC port range starts at port 5900 and this maps to VNC display 0. virsh vncdisplay gives you :7 for VNC port 5907 because of this. This this is the expected behavior for virsh vncdisplay. -- Matthias Bolte http://photron.blogspot.com