Apache Guacamole is a clientless remote desktop gateway, supporting VNC, RDP and SSH.

Set up Guacamole on FreeBSD

Update the system and install required packages

freebsd-update fetch && freebsd-update install
pkg update && pkg upgrade
pkg install guacamole-client guacamole-server
cp /usr/local/etc/guacamole-client/user-mapping.xml.sample /usr/local/etc/guacamole-client/user-mapping.xml
sysrc tomcat8_enable="YES"
sysrc guacd_enable="YES"

Prerequisites for the database

Guacamole-Client requires a database located on local or remote server. In this example we use MariaDB as it is widely known and supported. At the time of writing MariaDB 10.3 is the latest version and the MySQL Java Connector is at 8.0.15

pkg install mariadb103-server mysql-connector-java-8.0.15
sysrc mysql_enable="YES"
/usr/local/etc/rc.d/mysql-server start

Set up MariaDB SQL database

First we secure the new installation and set a root password for the MariaDB


Now it is time to connect to MariaDB and create our database

mysql -u root -p
CREATE USER 'guacamole'@'localhost' IDENTIFIED BY 'S3curePassw0rd';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole.* TO 'guacamole'@'localhost';

Prepare Guacamole

We add the tables and setup basic file and folder structure

cd /usr/local/share/guacamole-client/
tar xvfz guacamole-auth-jdbc.tar.gz
cd guacamole-auth-jdbc-1.0.0/mysql/schema
cat *.sql | mysql -u root -p guacamole
mkdir /usr/local/etc/guacamole-client/extensions
mkdir /usr/local/etc/guacamole-client/lib
cp /usr/local/share/guacamole-client/guacamole-auth-jdbc-1.0.0/mysql/guacamole-auth-jdbc-mysql-1.0.0.jar /usr/local/etc/guacamole-client/extensions/
cp /usr/local/share/java/classes/mysql-connector-java.jar /usr/local/etc/guacamole-client/lib/
cd /usr/local/etc/guacamole-client/

Connect Guacamole and MariaDB

The file must be filled with our new environment

guacd-hostname: localhost
guacd-port:     4822
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole
mysql-username: guacamole
mysql-password: S3curePassw0rd!
mysql-default-max-connections-per-user: 0
mysql-default-max-group-connections-per-user: 0

Restart the daemons

Finally we restart guacd and tomcat8

/usr/local/etc/rc.d/guacd restart
/usr/local/etc/rc.d/tomcat8 restart

Notes and further information

If you get a blank screen while connecting to http://<yourhost>:8080/guacamole/ check the logs:

tail -f /usr/local/apache-tomcat-8.0/logs/catalina.out

Maybe the timezone of MariaDB is wrong or unrecognized, then you have to set a new one that fits your region

mysql -u root -p
SET GLOBAL time_zone = '+2:00'; (hours counting from UTC)

CategoryHowTo CategoryPorts

Ports/www/guacamole-client (last edited 2019-06-11T10:26:39+0000 by KubilayKocak)