[Spice-devel] Adding SPICE support to Guacamole - spice-glib

Nick Couchman vnick at apache.org
Thu Jan 7 20:41:36 UTC 2021


On Thu, Jan 7, 2021 at 3:21 PM Marc-André Lureau <marcandre.lureau at gmail.com>
wrote:

> Hi
>
> On Fri, Jan 8, 2021 at 12:07 AM Nick Couchman <vnick at apache.org> wrote:
>
>> Hey, everyone,
>> I'm a contributor to the Guacamole project, and am currently working on
>> adding support for the SPICE protocol to Guacamole. If you haven't heard of
>> Guacamole, it is a protocol and associated software components for making
>> various remote desktop interfaces available via native HTML5 in browsers. I
>> realize that there is already a spice-html5 client, but, for various
>> reasons, we'd like to add the SPICE support to Guacamole, as well.
>>
>> Within Guacamole, the clients for the individual protocols are
>> implemented in a daemon - guacd - that is written in C. It accesses the
>> various remote desktop protocols that we support (VNC, RDP, SSH, and
>> Telnet, today) and does the translation to the Guacamole protocol. So, I am
>> attempting to write the SPICE client for this using the spice-glib library.
>>
>> I'm running into an issue with the code I've written thus far. I've
>> followed API documentation and some code examples, and I have it to where
>> I'm configuring all of the required pieces - hostname/IP, tls-port,
>> password, etc. I've set up the handlers for the session (channel-event) and
>> for the channels. When I attempt to connect, the SPICE client starts up,
>> the session starts/connects, and I see the main channel get created, but
>> the connection never progresses after that. As far as I can tell, it
>> doesn't even try any sort of connection to the SPICE server - I don't see
>> any network traffic going to the SPICE server, and it never progresses past
>> that point. I'm not seeing any errors - nothing that indicates it's tried
>> and failed, or is expecting additional input, or anything like that.
>>
>> I'm happy to share code if anyone is interested in looking at what I've
>> done so far, or if anyone has any generic hints as to what I might check or
>> resources that are helpful in writing a C-based client for SPICE, I'd
>> greatly appreciate the insight and help. I'm sure there's something
>> reasonably simple that I'm not doing, or doing out of order, but I'm a bit
>> stumped at the moment.
>>
>
> Spice uses multiple connections which are called channels for the various
> streams. You need to get and listen for available channels on the
> SpiceSession.
>
>
Thanks for the quick response, Marc-Andre. Yes, I've got a handler that is
supposed to listen for each of the channels to be created and then add the
signal handlers for each of those channels (and connect to them, where
applicable). The main channel is the only one that I ever see get created,
after running "spice_session_connect(session)" on the SpiceSession that
gets started. I never see the Display, Cursor, Input, Playback, Record, or
WebDav channels get created.


> Have you looked at some of the tools in spice-gtk source tree, for example
> spicy-screenshot.c ?
> https://gitlab.freedesktop.org/spice/spice-gtk/-/blob/master/tools/spicy-screenshot.c,
> this should give you a simple way to get started. You will need to handle
> the SpiceDisplayChannel, SpiceCursorChannel and SpiceInputsChannel to have
> basic UI remoting iirc.
>
>
Yeah, I've got tabs opened for the GitLab repo for spice-gtk, and I did
take a look at that. I'll take another, closer look and see if I can track
down what's different there from what I'm doing.

Again, appreciate the quick response and hints!

-Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20210107/3d101625/attachment.htm>


More information about the Spice-devel mailing list