Unable to use Guacamole Reverse VNC connection
Asked Answered
S

2

10

I am using Guacamole v0.9.9 and want to connect to my Win 10 laptop which is behind a NAT of my ISP.

I figured I might have to use Reverse VNC for this. The instructions are given here: https://guacamole.incubator.apache.org/doc/gug/configuring-guacamole.html#vnc-reverse-connections

But I am using MYSQL Auth as described here: https://guacamole.incubator.apache.org/doc/0.9.0/gug/mysql-auth.html

The problem is that I am not able to see any options for Reverse Connection in VNC settings and there is no XML file to put the parameters in.

enter image description here

Also there is no instruction what to do after that. In a conventional VNC connection you would run the client in the destination and run the server in listen/reverse mode after giving destination ip. In this case there is no client running. So I am clueless what to do next.

Any help will be much appreciated.

Sphincter answered 28/8, 2016 at 9:53 Comment(1)
Alternately you could use a vnc repeater as described in this answer.Unveil
Q
2

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.
--------------------------------------------
Quadruped answered 26/12, 2016 at 0:10 Comment(1)
I tried this give the correct information in user-mappind.xml and connect from windows pc using command .\tvnserver.exe -controlservice -connect 192.168.0.107:8000 using tightvnc server. But getting error Failed to connect tightvnc server.Stomodaeum
A
1

To save yourself some hassle you could use a vnc repeater, it will listen for connection from the vnc servers and viewers, and connect the servers and viewers that use the same id

You can get one from here

Get build packages

For Debian use

apt-get install linux-headers-`uname -r` libx11-6 libx11-dev x-window-system-core x-window-system xspecs libxtst6 psmisc build-essential

For CentOS use:

yum install linux-headers-`uname -r` libx11-6 libx11-dev x-window-system-core x-window-system xspecs libxtst6 psmisc build-essential

Get source into /usr/local/src

cd /usr/local/src
wget http://www.wisdomsoftware.gr/download/uvncrep017-ws.tar.gz

Unzip source file

gunzip uvncrep017-ws.tar.gz
tar -xvf uvncrep017-ws.tar

Install startup script

cd uvncrep017-ws
make; make install;

Add a user for the service

useradd uvncrep

Edit /etc/uvnc/uvncrepeater.ini according to your needs.

Check the following parameters:

viewerport = 5901
maxsessions = 10
runasuser = uvncrep
logginglevel = 2
srvListAllow1 = 192.168.0.0 ;Allow network 192.168.x.x
srvListDeny0 = 127.0.0.1 ;Deny loopback
requirelistedserver=1

Start the service

/etc/init.d/uvncrepeater start

Original link: here

Discussion on a board about this: here

Auberon answered 26/12, 2016 at 12:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.