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

Marc-André Lureau marcandre.lureau at gmail.com
Thu Jan 7 20:21:42 UTC 2021


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.

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.

Hope that helps

-- 
Marc-André Lureau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20210108/0f5c6edb/attachment.htm>


More information about the Spice-devel mailing list