Mailing List Archive

noVNC and consoles from XAPI
Hi guys,

Xen-Orchestra team reporting ;)


We are experiencing some difficulties to get VNC consoles from XAPI
witn noVNC. We try to get some inspiration from XAC project and other
resources on the web [1], but without any success. The documentation
is quite unclear about the HTTP Connect [2], because despite the steps
we followed, we've got "strange" errors.

Our code is fairly simple by the way [3], but we've got "Error during
WebSocket handshake: Sec-WebSocket-Protocol mismatch". I think we miss
something with the HTTP connect step, but XAC is pretty similar to our
code, and it seems to connect directly VNC console like us.

Important thing to note: we aren't executing XO on the XAPI host. And
we are testing this XenServer's hosts (6.2)

If you have any clue, It can really help us to speed up release date for XO :)


Thanks,


Olivier.



[1] : http://olivier.monaco.free.fr/techblog/index.php/2009/10/03/access-vnc-console-of-a-citrix-xen-vm-using-xen-sdk/
[2] : http://community.citrix.com/display/xs/XenServer+Software+Development+Kit+Guide#XenServerSoftwareDevelopmentKitGuide-6.1.1.%26nbsp%3BRetrievingVNCconsolesviatheAPI
[3] : important stuff is between lines 636 to 687 ->
https://github.com/vatesfr/xo-web/blob/web-app/public/js/xo.js

Condensed version:
------
var VMConsoleView = ItemView.extend({
'template': '#tpl-vm-console',
'initialize': function () {
var view = this;
var vm_console = _.findWhere(this.model.get('consoles'), {
'protocol': 'rfb',
});
// @todo Comment.
var parse_url = function (url) {
var a = window.document.createElement('a');
a.href = url;
return {
'host': a.hostname,
'port': a.port || ('https:' === a.protocol) ? 443 :80,
'path': a.pathname,
'query': a.search,
};
};
var url = parse_url(vm_console.location);
var pool = app.pools.get(this.model.get('pool_uuid'));
url.query += '&session_id='+ pool.get('sessionId');
console.log(url);
view.on('dom:refresh', function () {
view.rfb = new RFB({
// Options.
'encrypt': (443 === url.port),
'target': view.$('canvas')[0],
// Callbacks.
'onPasswordRequired': function (rfb) {
rfb.sendPassword(window.prompt('password:'));
},
'onUpdateState': function () {
console.log(arguments);
},
});
view.rfb.connect(
url.host,
url.port,
'',
url.path.substr(1) + url.query
);
});
},
});
---------

_______________________________________________
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
Re: noVNC and consoles from XAPI [ In reply to ]
On 26-07-13 15:50, "Olivier Lambert" <lambert.olivier@gmail.com> wrote:

>Hi guys,
>
>Xen-Orchestra team reporting ;)
>
>
>We are experiencing some difficulties to get VNC consoles from XAPI
>witn noVNC. We try to get some inspiration from XAC project and other
>resources on the web [1], but without any success. The documentation
>is quite unclear about the HTTP Connect [2], because despite the steps
>we followed, we've got "strange" errors.
>
>Our code is fairly simple by the way [3], but we've got "Error during
>WebSocket handshake: Sec-WebSocket-Protocol mismatch". I think we miss
>something with the HTTP connect step, but XAC is pretty similar to our
>code, and it seems to connect directly VNC console like us.
>
>Important thing to note: we aren't executing XO on the XAPI host. And
>we are testing this XenServer's hosts (6.2)
>
>If you have any clue, It can really help us to speed up release date for
>XO :)
>
>
>Thanks,
>
>
>Olivier.


Hey,

So I think I ran into the same problem when trying to get noVNC upstream
to work with my library
(https://github.com/HPieters/xenapi-jquery/tree/master/examples/vnc). I
ended up changing the protocol to "chat" instead of binary or base64 in
the websock.js of noVNC
(https://github.com/HPieters/xenapi-jquery/blob/master/examples/vnc/include
/websock.js#L298) and that fixed it for me.

Cheers,
Harrie


_______________________________________________
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
Re: noVNC and consoles from XAPI [ In reply to ]
Thanks Harrie,

I made the change, but I'm stuck on this error now:
"failed: WebSocket is closed before the connection is established. "

The strange thing is I've got exactly the same error with your
xenapi-jquery app on my JS console (on the web page, I've got "Connect
timeout")

I double/triple-checked if my credentials were right, I'm running on
the same network without any firewall etc. And it works with
XenCenter...

On Fri, Jul 26, 2013 at 6:39 PM, Harrie Pieters (Intern)
<harrie.pieters@citrix.com> wrote:
> On 26-07-13 15:50, "Olivier Lambert" <lambert.olivier@gmail.com> wrote:
>
>>Hi guys,
>>
>>Xen-Orchestra team reporting ;)
>>
>>
>>We are experiencing some difficulties to get VNC consoles from XAPI
>>witn noVNC. We try to get some inspiration from XAC project and other
>>resources on the web [1], but without any success. The documentation
>>is quite unclear about the HTTP Connect [2], because despite the steps
>>we followed, we've got "strange" errors.
>>
>>Our code is fairly simple by the way [3], but we've got "Error during
>>WebSocket handshake: Sec-WebSocket-Protocol mismatch". I think we miss
>>something with the HTTP connect step, but XAC is pretty similar to our
>>code, and it seems to connect directly VNC console like us.
>>
>>Important thing to note: we aren't executing XO on the XAPI host. And
>>we are testing this XenServer's hosts (6.2)
>>
>>If you have any clue, It can really help us to speed up release date for
>>XO :)
>>
>>
>>Thanks,
>>
>>
>>Olivier.
>
>
> Hey,
>
> So I think I ran into the same problem when trying to get noVNC upstream
> to work with my library
> (https://github.com/HPieters/xenapi-jquery/tree/master/examples/vnc). I
> ended up changing the protocol to "chat" instead of binary or base64 in
> the websock.js of noVNC
> (https://github.com/HPieters/xenapi-jquery/blob/master/examples/vnc/include
> /websock.js#L298) and that fixed it for me.
>
> Cheers,
> Harrie
>

_______________________________________________
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
Re: noVNC and consoles from XAPI [ In reply to ]
Hi Olivier,



We have the same problem here. Did you get "noVNC" working? He also tried
Harrie's change but with no luck.

He noted that the same code works correctly over XCP 1.6 but is not working
over XS6.2 hosts.

Thanks in advance.









Narcís Escarpanter

Technical Area – SWHosting



<http://www.swhosting.com> http://www.swhosting.com

<http://blog.swhosting.com> http://blog.swhosting.com

Tel. 902 010 664 - Tel. Int. <tel:%2B34%20972%20010%20550> +34 972 010 550

Fax 902 510 664 - Fax Int. <tel:%2B34%20972%20010%20555> +34 972 010 555



Descripción: Descripción: green Please, consider the environment before
printing this email.

LEGAL NOTICE

SW Hosting & Communications Technologies, SL informs you that this message
is intended exclusively for its addressee and contains confidential and / or
sensitive information subject to professional secrecy and protected by the
current legislation. If you are not the intended recipient, we notify you
that the reading, use, disclosure, reproduction, distribution, printing and
/ or copy of this communication, information and / or any attachments to it
are strictly prohibited by law. If you have received this message by
mistake, please notify it to us immediately replying to the sender of the
message and then delete it with all the attachments if any.





-----Mensaje original-----
De: xen-api-bounces@lists.xen.org [mailto:xen-api-bounces@lists.xen.org] En
nombre de Olivier Lambert
Enviado el: sábado, 27 de julio de 2013 14:55
Para: Harrie Pieters (Intern)
CC: xen-api@lists.xensource.com
Asunto: Re: [Xen-API] noVNC and consoles from XAPI



Thanks Harrie,



I made the change, but I'm stuck on this error now:

"failed: WebSocket is closed before the connection is established. "



The strange thing is I've got exactly the same error with your xenapi-jquery
app on my JS console (on the web page, I've got "Connect

timeout")



I double/triple-checked if my credentials were right, I'm running on the
same network without any firewall etc. And it works with XenCenter...



On Fri, Jul 26, 2013 at 6:39 PM, Harrie Pieters (Intern) <
<mailto:harrie.pieters@citrix.com> harrie.pieters@citrix.com> wrote:

> On 26-07-13 15:50, "Olivier Lambert" < <mailto:lambert.olivier@gmail.com>
lambert.olivier@gmail.com> wrote:

>

>>Hi guys,

>>

>>Xen-Orchestra team reporting ;)

>>

>>

>>We are experiencing some difficulties to get VNC consoles from XAPI

>>witn noVNC. We try to get some inspiration from XAC project and other

>>resources on the web [1], but without any success. The documentation

>>is quite unclear about the HTTP Connect [2], because despite the steps

>>we followed, we've got "strange" errors.

>>

>>Our code is fairly simple by the way [3], but we've got "Error during

>>WebSocket handshake: Sec-WebSocket-Protocol mismatch". I think we miss

>>something with the HTTP connect step, but XAC is pretty similar to our

>>code, and it seems to connect directly VNC console like us.

>>

>>Important thing to note: we aren't executing XO on the XAPI host. And

>>we are testing this XenServer's hosts (6.2)

>>

>>If you have any clue, It can really help us to speed up release date

>>for XO :)

>>

>>

>>Thanks,

>>

>>

>>Olivier.

>

>

> Hey,

>

> So I think I ran into the same problem when trying to get noVNC

> upstream to work with my library

> ( <https://github.com/HPieters/xenapi-jquery/tree/master/examples/vnc>
https://github.com/HPieters/xenapi-jquery/tree/master/examples/vnc).

> I ended up changing the protocol to "chat" instead of binary or base64

> in the websock.js of noVNC

> ( <https://github.com/HPieters/xenapi-jquery/blob/master/examples/vnc/in>
https://github.com/HPieters/xenapi-jquery/blob/master/examples/vnc/in

> clude

> /websock.js#L298) and that fixed it for me.

>

> Cheers,

> Harrie

>



_______________________________________________

Xen-api mailing list

<mailto:Xen-api@lists.xen.org> Xen-api@lists.xen.org

<http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api>
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
Re: noVNC and consoles from XAPI [ In reply to ]
Narcis,

It works in Xen Orchestra since version 3.2 (see
https://xen-orchestra.com/xen-orchestra-3-2/)

We fixed the problem and our patch was merged in NoVNC project (see
https://github.com/kanaka/noVNC/pull/338)


On Wed, May 28, 2014 at 6:17 PM, Narcís Escarpanter <
nescarpanter@swhosting.com> wrote:

> Hi Olivier,
>
>
>
> We have the same problem here. Did you get "noVNC" working? He also tried
> Harrie's change but with no luck.
>
> He noted that the same code works correctly over XCP 1.6 but is not
> working over XS6.2 hosts.
>
> Thanks in advance.
>
>
>
>
>
>
>
>
>
> Narcís Escarpanter
>
> Technical Area – *SWHosting*
>
>
>
> http://www.swhosting.com
>
> http://blog.swhosting.com
>
> Tel. 902 010 664 - Tel. Int. +34 972 010 550
>
> Fax 902 510 664 - Fax Int. +34 972 010 555
>
>
>
> [image: Descripción: Descripción: green] Please, consider the
> environment before printing this email.
>
> LEGAL NOTICE
>
> SW Hosting & Communications Technologies, SL informs you that this message
> is intended exclusively for its addressee and contains confidential and
> / or sensitive information subject to professional secrecy and protected by
> the current legislation. If you are not the intended recipient, we notify
> you that the reading, use, disclosure, reproduction, distribution, printing
> and / or copy of this communication, information and / or any
> attachments to it are strictly prohibited by law. If you have received this
> message by mistake, please notify it to us immediately replying to
> the sender of the message and then delete it with all the
> attachments if any.
>
>
>
>
>
> -----Mensaje original-----
> De: xen-api-bounces@lists.xen.org [mailto:xen-api-bounces@lists.xen.org]
> En nombre de Olivier Lambert
> Enviado el: sábado, 27 de julio de 2013 14:55
> Para: Harrie Pieters (Intern)
> CC: xen-api@lists.xensource.com
> Asunto: Re: [Xen-API] noVNC and consoles from XAPI
>
>
>
> Thanks Harrie,
>
>
>
> I made the change, but I'm stuck on this error now:
>
> "failed: WebSocket is closed before the connection is established. "
>
>
>
> The strange thing is I've got exactly the same error with your
> xenapi-jquery app on my JS console (on the web page, I've got "Connect
>
> timeout")
>
>
>
> I double/triple-checked if my credentials were right, I'm running on the
> same network without any firewall etc. And it works with XenCenter...
>
>
>
> On Fri, Jul 26, 2013 at 6:39 PM, Harrie Pieters (Intern) <
> harrie.pieters@citrix.com> wrote:
>
> > On 26-07-13 15:50, "Olivier Lambert" <lambert.olivier@gmail.com> wrote:
>
> >
>
> >>Hi guys,
>
> >>
>
> >>Xen-Orchestra team reporting ;)
>
> >>
>
> >>
>
> >>We are experiencing some difficulties to get VNC consoles from XAPI
>
> >>witn noVNC. We try to get some inspiration from XAC project and other
>
> >>resources on the web [1], but without any success. The documentation
>
> >>is quite unclear about the HTTP Connect [2], because despite the steps
>
> >>we followed, we've got "strange" errors.
>
> >>
>
> >>Our code is fairly simple by the way [3], but we've got "Error during
>
> >>WebSocket handshake: Sec-WebSocket-Protocol mismatch". I think we miss
>
> >>something with the HTTP connect step, but XAC is pretty similar to our
>
> >>code, and it seems to connect directly VNC console like us.
>
> >>
>
> >>Important thing to note: we aren't executing XO on the XAPI host. And
>
> >>we are testing this XenServer's hosts (6.2)
>
> >>
>
> >>If you have any clue, It can really help us to speed up release date
>
> >>for XO :)
>
> >>
>
> >>
>
> >>Thanks,
>
> >>
>
> >>
>
> >>Olivier.
>
> >
>
> >
>
> > Hey,
>
> >
>
> > So I think I ran into the same problem when trying to get noVNC
>
> > upstream to work with my library
>
> > (https://github.com/HPieters/xenapi-jquery/tree/master/examples/vnc).
>
> > I ended up changing the protocol to "chat" instead of binary or base64
>
> > in the websock.js of noVNC
>
> > (https://github.com/HPieters/xenapi-jquery/blob/master/examples/vnc/in
>
> > clude
>
> > /websock.js#L298) and that fixed it for me.
>
> >
>
> > Cheers,
>
> > Harrie
>
> >
>
>
>
> _______________________________________________
>
> Xen-api mailing list
>
> Xen-api@lists.xen.org
>
> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
>