{"id":2264,"date":"2019-02-23T15:52:37","date_gmt":"2019-02-23T12:52:37","guid":{"rendered":"http:\/\/kifarunix.com\/?p=2264"},"modified":"2019-03-02T10:59:41","modified_gmt":"2019-03-02T07:59:41","slug":"how-to-install-and-setup-guacamole-on-debian-9-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-install-and-setup-guacamole-on-debian-9-8\/","title":{"rendered":"How to Install and Setup Guacamole on Debian 9.8"},"content":{"rendered":"
Welcome to our tutorial on how to install and Setup Guacamole on Debian 9.8. We covered a similar setup on Ubuntu 18.04 in our previous article which you can check using the link below;<\/p>\n
You may as well would like to learn how to setup NoMachine on Ubuntu 18.04;<\/p>\n
As a pre-requisite to install and setup Guacamole on Debian 9.8, install the following required dependencies.<\/p>\n
apt install -y gcc-6 g++-6 libcairo2-dev libjpeg62-turbo-dev libpng-dev \\\r\nlibossp-uuid-dev libavcodec-dev libavutil-dev libswscale-dev libfreerdp-dev \\\r\nlibpango1.0-dev libssh2-1-dev libvncserver-dev libssl-dev libvorbis-dev libwebp-dev<\/code><\/pre>\nInstall Tomcat application server<\/h3>\n
Once the installation of the dependencies above is done, proceed to install Tomcat servelet container for serving guacamole client contents to users connecting to the Guacamole server via web.<\/p>\n
apt install tomcat8 tomcat8-admin tomcat8-common tomcat8-user<\/code><\/pre>\nInstalling Guacamole server on Debian 9<\/h3>\n
As much as Guacamole server is available on the default Debian repositories, it may not be upto-date. Hence, building it from the source code is a sure bet to get the latest version installed. In that case, navigate to Guacamole Source code download page<\/a> and grab the latest version.<\/p>\n
Once you obtain the download link, you can use wget to pull the source code to your server.<\/p>\n
wget https:\/\/sourceforge.net\/projects\/guacamole\/files\/current\/source\/guacamole-server-0.9.14.tar.gz<\/code><\/pre>\nExtract the tarball and proceed to install Guacamole Server on Debian 9.<\/p>\n
tar xzf guacamole-server-0.9.14.tar.gz<\/code><\/pre>\nNavigate to the Guacamole source code directory and initialize the installation process by running the configure script as shown below;<\/p>\n
cd guacamole-server-0.9.14\/\r\n.\/configure --with-init-dir=\/etc\/init.d<\/code><\/pre>\nThis generates a Makefile that adapts Guacamole to the Debian system. After that, proceed to compile Guacamole by running the
make<\/code> command as shown below;<\/p>\n
make<\/code><\/pre>\nOnce the compilation is done, you can install Guacamole server by running the
make install<\/code> command.<\/p>\n
make install<\/code><\/pre>\nRun
ldconfig<\/code> command to create the necessary links and cache to the shared\u00a0Guacamole libraries.<\/p>\n
Start and enable Guacamole server to run on system boot.<\/p>\n
systemctl enable guacd\r\nsystemctl start guacd<\/code><\/pre>\nInstall Guacamole Client<\/h3>\n
Guacamole client is an HTML5 web application that provides a client to be served by the Tomcat servelet container. Guacamole client is available as binary and can be downloaded from the Guacamole source page<\/a>. The Guacamole client should be placed under the Guacamole configuration directory,
\/etc\/guacamole<\/code>, which is not available by default and hence can be created as shown below;
\n<\/span><\/p>\nmkdir \/etc\/guacamole\r\nwget https:\/\/sourceforge.net\/projects\/guacamole\/files\/current\/binary\/guacamole-0.9.14.war -O \/etc\/guacamole\/guacamole.war<\/code><\/pre>\nNext, create a symbolic link of the guacamole client to Tomcat webapps libraries.<\/p>\n
ln -s \/etc\/guacamole\/guacamole.war \/var\/lib\/tomcat8\/webapps\/<\/code><\/pre>\nOnce that is done, restart Tomcat to deploy the Guacamole client web application. Restart Guacamole daemon after that.<\/p>\n
systemctl restart tomcat8\r\nsystemctl restart guacd<\/code><\/pre>\nConfiguring Guacamole<\/h3>\n
The major configuration files for Guacamole server resides under
\/etc\/guacamole<\/code>. You therefore need to create the extensions and libraries configuration directories.
\n<\/span><\/p>\nmkdir \/etc\/guacamole\/{extensions,lib}<\/code><\/pre>\nGuacamole references
\/etc\/guacamole<\/code><\/span> as its home directory and hence, you need to create the environment variable for this under the tomcat configuration file.<\/p>\n
echo \"GUACAMOLE_HOME=\/etc\/guacamole\" | sudo tee -a \/etc\/default\/tomcat8<\/code><\/pre>\nGuacamole Web application used the
guacamole.properties<\/code> as its main configuration file. Therefore, we are going to define the authentication providers for Guacamole in this file.<\/p>\n
In this guide, we are going to use MySQL database for authentications. Hence, install MariaDB server as shown below;<\/p>\n
apt install mariadb-server -y<\/code><\/pre>\nRun the initial MySQL security script to remove default test databases, anonymous users and set the root user password.<\/p>\n
mysql_secure_installation<\/code><\/pre>\nNext, login to the MySQL as root user and create Guacamole database and the database user for accessing and manipulating data. You can use whatever database and user names.<\/p>\n
mysql -u root -p\r\ncreate database guacamole;\r\ngrant SELECT,INSERT,UPDATE,DELETE ON guacamole.* to guadmin@localhost identified by 'P@ssWord';\r\nflush privileges;\r\nquit<\/code><\/pre>\nInstall the Java database (JDBC) driver for MySQL or MariaDB <\/span><\/span><\/p>\n
apt install libmysql-java<\/code><\/pre>\nCreate a symlink\u00a0 of MySQL JDBC driver to Guacamole libraries.<\/p>\n
ln -s \/usr\/share\/java\/mysql-connector-java.jar \/etc\/guacamole\/lib\/<\/code><\/pre>\nNext, you need to download the Guacamole java driver authentication component from Guacamole extensions page<\/a>.<\/p>\n
wget https:\/\/sourceforge.net\/projects\/guacamole\/files\/current\/extensions\/guacamole-auth-jdbc-0.9.14.tar.gz<\/code><\/pre>\nExtract the archive and copy MySQL authentication extension to the Guacamole extensions directory.<\/p>\n
tar xzf guacamole-auth-jdbc-0.9.14.tar.gz\r\ncp guacamole-auth-jdbc-0.9.14\/mysql\/guacamole-auth-jdbc-mysql-0.9.14.jar \/etc\/guacamole\/extensions\/<\/code><\/pre>\nImport the MySQL JDBC driver schemas to Guacamole database you created above.<\/p>\n
cat guacamole-auth-jdbc-0.9.14\/mysql\/schema\/*.sql | mysql -u root -p guacamole<\/code><\/pre>\nThe database is now ready for authentication purposes. Next, edit
guacamole.properties<\/code> and define the how clients will connect to Guacamole server.<\/p>\n
vim \/etc\/guacamole\/guacamole.properties<\/code><\/pre>\n# Hostname and Guacamole server port\r\nguacd-hostname: localhost\r\nguacd-port: 4822\r\n\r\n# MySQL Connection Details\r\nmysql-hostname: localhost<\/strong>\r\nmysql-port: 3306<\/strong>\r\nmysql-database: guacamole<\/strong>\r\nmysql-username: guadmin<\/strong>\r\nmysql-password: P@ssWord<\/strong><\/code><\/pre>\nSave the configuration file and create a symlink of the Guacamole configurations to Tomcat servlet .<\/p>\n
ln -s \/etc\/guacamole \/usr\/share\/tomcat8\/.guacamole<\/code><\/p>\n
Restart both Tomcat and guacd to effect the changes.<\/p>\n
systemctl restart tomcat8\r\nsystemctl restart guacd<\/code><\/pre>\nNext, login to Guacamole Web interface by navigating to
http:\/\/server-IP:8080\/guacamole<\/code>. The default login credentials are:
guacadmin<\/code> for both password and username.<\/p>\n
<\/a><\/p>\n
If you need to reset the guacadmin user password, Navigate to user profile icon and click on the dropdown, Settings and Preferences.<\/p>\n