Ok thanks. That was what I expected. May be we could do<div><br></div><div>port - VNC_BASE_PORT</div><div><br></div><div>seems safer to me.. thoughts?</div><div><br></div><div>Cheers</div><div><br></div><div>Ruben<br><br><div class="gmail_quote">

On Fri, Oct 8, 2010 at 12:30 PM, Tiago Batista <span dir="ltr"><<a href="mailto:tiagosbatista@gmail.com">tiagosbatista@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

It does work as long as it is opennebula generating the port numbers<br>
(with 5900 as the base) and it does work for static port assignments:<br>
<br>
the template<br>
<br>
GRAPHICS =[type="vnc", passwd="qwerty", port="5900"]<br>
<br>
translates to "vncdisplay=0" that is translated by xen back to 5900...<br>
<br>
and the template<br>
<br>
GRAPHICS =[type="vnc", passwd="qwerty"]<br>
<br>
translates to "vncdisplay=vmId" that is translated by xen back to<br>
5900+vmid as intended<br>
<br>
The current code translates port 5900 to vncdisplay 5900, xen then<br>
adds another 5900, ending up listening on port 11800 while openebula<br>
claims the port to be 5900! So, I am just offsetting the 5900 that is<br>
going to be added by xen on the next step!<br>
<br>
What is the situation where opennebula is not the generator of the<br>
port number? I have tested it successfully with and without port<br>
numbers on the template, and I think of no usecase where this fails as<br>
long as VNC_BASE_PORT=5900...<br>
<font color="#888888"><br>
Tiago<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
On Thu, Oct 7, 2010 at 10:51 PM, Ruben S. Montero <<a href="mailto:rubensm@dacya.ucm.es">rubensm@dacya.ucm.es</a>> wrote:<br>
><br>
> Hi<br>
> Yes this is a Xen specific bug. vncdisplay sets the port by adding 5900. That is already done by OpenNebula (e.g. to use it with KVM).<br>
> So your solution seems fine for the port generation but, if the port is not generated by OpenNebula we will be substracting 5900...<br>
> Thanks for the feedback!<br>
> Ruben<br>
> On Wed, Oct 6, 2010 at 5:17 PM, Tiago Batista <<a href="mailto:tiagosbatista@gmail.com">tiagosbatista@gmail.com</a>> wrote:<br>
>><br>
>> Hello all<br>
>><br>
>> 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)<br>
>><br>
>> The following patch solves it but forces the base port in oned.conf to be set to 5900 if using the xen driver.<br>
>><br>
>> 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!<br>


>><br>
>> Anyway.... This solves my problem!<br>
>><br>
>><br>
>> --- one-2.0-beta1/src/vmm/XenDriver.cc    2010-07-27 15:34:04.000000000 +0100<br>
>> +++ one-2.0-beta1_mod/src/vmm/XenDriver.cc    2010-09-21 10:07:32.000000000 +0100<br>
>> @@ -364,12 +364,10 @@<br>
>>                  {<br>
>>                      file << ",vnclisten=" << listen;<br>
>>                  }<br>
>> -<br>
>>                  if ( !port.empty() )<br>
>>                  {<br>
>> -                    file << ",vncdisplay=" << port;<br>
>> +                    file << ",vncdisplay=" << (atoi(port.c_str())-5900);<br>
>>                  }<br>
>> -<br>
>>                  if ( !passwd.empty() )<br>
>>                  {<br>
>>                      file << ",vncpasswd=" << passwd;<br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
>> <a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Dr. Ruben Santiago Montero<br>
> Associate Professor (Profesor Titular), Complutense University of Madrid<br>
><br>
> URL: <a href="http://dsa-research.org/doku.php?id=people:ruben" target="_blank">http://dsa-research.org/doku.php?id=people:ruben</a><br>
> Weblog: <a href="http://blog.dsa-research.org/?author=7" target="_blank">http://blog.dsa-research.org/?author=7</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Dr. Ruben Santiago Montero<br>Associate Professor (Profesor Titular), Complutense University of Madrid<br><br>URL: <a href="http://dsa-research.org/doku.php?id=people:ruben" target="_blank">http://dsa-research.org/doku.php?id=people:ruben</a><br>

Weblog: <a href="http://blog.dsa-research.org/?author=7" target="_blank">http://blog.dsa-research.org/?author=7</a><br>
</div>