There are a few things you'll need to do in order to setup the reverse-connect
functionality:
So in a typical authorization scenario you have something like this in the user-mapping.xml
with the necessary information for the reverse-connect:
<authorize username="user" password="password">
<connection name="reverse">
<protocol>vnc</protocol>
<param name="hostname">localhost</param>
<param name="port">9999</param>
<param name="reverse-connect">true</param>
<param name="listen-timeout">30000</param>
<param name="autoretry">true</param>
</connection>
</authorize>
Since you are doing this through MySQL it's the same principle:
Connections and parameters
Each connection has an entry in the guacamole_connection table, with a
one-to-many relationship to parameters, stored as name/value pairs in
the guacamole_connection_parameter table.
The guacamole_connection table is simply a pairing of a unique and
descriptive name with the protocol to be used for the connection. Adding a connection and corresponding parameters is relatively easy compared to adding a user as there is no salt to generate nor password to hash:
-- Create connection
INSERT INTO guacamole_connection (connection_name, protocol) VALUES ('reverse', 'vnc');
SET @id = LAST_INSERT_ID();
-- Add parameters
INSERT INTO guacamole_connection_parameter VALUES (@id, 'hostname', 'localhost');
INSERT INTO guacamole_connection_parameter VALUES (@id, 'port', '9999');
INSERT INTO guacamole_connection_parameter VALUES (@id, 'reverse-connect', 'true');
...
Connecting:
Open the connection within Guacamole, then connect to the port on the Guacamole Server with the VNC client (eg. :9999
as shown in the example above). If you don't open the connection within Guacamole first, guacd
won't be listening on the given port.
If you cannot establish a connection after setting up the user-mapping.xml
or MySQL authorization that includes the reverse-connect parameter, it's suggested to install the latest version of libvncserver
, which has ENABLED_VNC_LISTEN
defined. You should notice when executing Guacamole's ./configure
a warning if it's not defined:
--------------------------------------------
No listening support found in libvncclient.
Support for listen-mode connections will not be built.
--------------------------------------------