[one-users] Xen driver and automatic VNC port generation

Tiago Batista tiagosbatista at gmail.com
Wed Oct 6 08:17:46 PDT 2010


Hello all

I am using Centos, and to be honnest I am not sure if this is platform
specific, but the standard port generation code for xen does not work here
(both 2.0 beta 1 and rc1)

The following patch solves it but forces the base port in oned.conf to be
set to 5900 if using the xen driver.

I rememmber reading somewhere that the port number is 5900 + vnc  display
number... In this case I used the generated port number to calculate the
display number, but given that the port number is calculated from the VM id,
I expect that there should be a cleaner way to do this!

Anyway.... This solves my problem!


--- one-2.0-beta1/src/vmm/XenDriver.cc    2010-07-27 15:34:04.000000000
+0100
+++ one-2.0-beta1_mod/src/vmm/XenDriver.cc    2010-09-21 10:07:32.000000000
+0100
@@ -364,12 +364,10 @@
                 {
                     file << ",vnclisten=" << listen;
                 }
-
                 if ( !port.empty() )
                 {
-                    file << ",vncdisplay=" << port;
+                    file << ",vncdisplay=" << (atoi(port.c_str())-5900);
                 }
-
                 if ( !passwd.empty() )
                 {
                     file << ",vncpasswd=" << passwd;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20101006/a079d948/attachment-0002.htm>


More information about the Users mailing list