Categories: DebianHow-To

Compile Guacamole from source on Debian or Ubuntu

Compile Guacamole from source on Debian or Ubuntu

You have ever asked yourself howto build your own .deb packages specially for the new neat Guacamole RDP Web Gateway. Concerning that there is no prebuild .deb package for Ubuntu 12.10 (Quantal) or Debian 7 (Wheezy) yet
i wrote this article to make own ones following this tutorial.

 

Prerequisites:

  • automake
  • gcc
  • bintutils
  • maven
  • tomcat6
  • openjdk-7-jdk
  • libglib2.0-dev
  • libvncserver-dev
  • libfreerdp-dev
  • libcairo2-dev
  • libvorbis-dev
  • checkinstall

+ Some time for compiling tasks 😉

Install the necessary packages:

aptitude install automake gcc binutils maven tomcat6 openjdk-7-jdk libglib2.0-dev libvncserver-dev libfreerdp-dev libcairo2-dev libvorbis-dev checkinstall

 

Latest source files for compiling you get here:
http://sourceforge.net/projects/guacamole/files/current/source/

Let’s start with compiling libguac

cd /opt/
wget http://sourceforge.net/projects/guacamole/files/current/source/libguac-0.7.0.tar.gz
tar xvzf libguac-0.7.0.tar.gz
cd libguac-0.7.0/
./configure
make
checkinstall --pkgname=libguac-dev -D make install
ldconfig

Answer the set package docs question with: yes then enter your Package description and press return twice. After that some more questions will show up.
Then press key: 4 and set the Release field to 1.0 and press enter. Just press return to take
the rest of default settings they are ok.

Package has been packed into /opt/libguac-0.7.0/libguac-dev_0.7.0-1_amd64.deb and installed now.
Keep the .deb for future purposes or other systems if you like.
Easy huh?

 

Now we build guacd proxy daemon from source

cd /opt/
wget http://sourceforge.net/projects/guacamole/files/current/source/guacd-0.7.0.tar.gz
tar xvzf guacd-0.7.0.tar.gz
cd guacd-0.7.0/
./configure --with-init-dir=/etc/init.d
make
checkinstall --pkgname=guacd-dev -D make install
ldconfig

 

Now let’s build our rdp and vnc clients from source

cd /opt/
wget http://sourceforge.net/projects/guacamole/files/current/source/libguac-client-rdp-0.7.1.tar.gz
tar xvzf libguac-client-rdp-0.7.1.tar.gz
cd libguac-client-rdp-0.7.1/
./configure
make
checkinstall --pkgname=libguac-client-rdp-dev -D make install
ldconfig
cd /opt/
wget http://sourceforge.net/projects/guacamole/files/current/source/libguac-client-vnc-0.7.0.tar.gz
tar xvzf libguac-client-vnc-0.7.0.tar.gz
cd libguac-client-vnc-0.7.0/
./configure
make
checkinstall --pkgname=libguac-client-vnc-dev -D make install
ldconfig

 

Finally build guacamole web application with maven

cd /opt/
wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-0.7.0.tar.gz
tar xvzf guacamole-0.7.0.tar.gz
cd guacamole-0.7.0/
mvn package
mkdir /etc/guacamole
cp doc/example/guacamole.properties /etc/guacamole/
ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat6/lib/
cp doc/example/user-mapping.xml /etc/guacamole/
cp target/guacamole-0.7.0.war /var/lib/tomcat6/webapps/guacamole.war

 

Configuring guacamole

change guacamole.properties that it looks like this:

vi /etc/guacamole/guacamole.properties
change-user-mapping: /etc/guacamole/user-mapping.xml

clear or modify the user-mapping.xml as you need it.

Example Configuration like I’m using:

<user-mapping>
<authorize
username="LoginUser"
password="yourHASHkeyHere"
encoding="md5">
<connection name="connection1">
<protocol>rdp</protocol>
<param name="hostname">192.168.1.1</param>
<param name="port">3389</param>
<param name="username">yourusername</param>
<param name="password">yourpass</param>
<param name="width">1024</param>
<param name="height">768</param>
<param name="color-depth">16</param>
</connection>
<connection name="connection2">
<protocol>rdp</protocol>
<param name="hostname">192.168.1.2</param>
<param name="port">3389</param>
<param name="username">yourusername</param>
<param name="password">yourpass</param>
<param name="width">1024</param>
<param name="height">768</param>
<param name="color-depth">16</param>
</connection>
</authorize>
</user-mapping>

encrypted password hash for user-mapping.xml can be generated using:

echo -n "yourPasswordHere" | md5sum

If you wanna have secure connection to your guacamole web session you have to finish following tasks:

Generate SSL keys (remind your used Password for later task)

keytool -genkey -alias tomcat -keyalg RSA
mv ~/.keystore /etc/tomcat6/

After line in server.xml:

<Service name="Catalina">

append this to your config:

keystoreFile="/etc/tomcat6/.keystore" keystorePass="yourPreviousRemindedKeystorePass"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />

 

Prepare autostart service and start/restart guacd, tomcat6

update-rc.d guacd defaults
service guacd start
service tomcat6 restart

And open your Browser: https://yourIP:8443/guacamole/

 

Screenshot logged in:

Jules

Jules is the owner and author of ISPIRE.ME. He's a Linux System Engineer, Tech fanatic and an Open Source fan.

View Comments

  • Can u explain what this means in use-mapping.xml

    rdp

    192.168.1.1
    3389
    yourusername
    yourpass

    hostname - server ip address or localhost??

    is port no. specific?? do we specify it anywhere before??

    yourusername and yourpassword.. what are they?? how are they different from username password in authorize??

    Thanks would like ur clarification as I am stuck here now...??

Recent Posts

HTTP/2 SSL Offloading with Hitch and Varnish

HTTP/2 SSL Offloading with Hitch and Varnish Since Chrome browsers showing you insecure warning on…

7 years ago

File changed as we read it GlusterFS issue

File changed as we read it GlusterFS issue Recently i had trouble running Backups of…

8 years ago

Running multiple instances of varnish using systemd

Running multiple instances of varnish using systemd If you have not yet found a complete…

8 years ago

HTTP/2 SSL Offloading with Haproxy and Nginx

HTTP/2 SSL Offloading with Haproxy and Nginx After HTTP/2 becoming more an more prominent regarding SSL…

8 years ago

Get Real IP with Haproxy Tomcat Jira Confluence using x-forwarded-for

Get Real IP with Haproxy Tomcat Jira Confluence using x-forwarded-for Everyone knows the Problem. Get…

8 years ago

Review TDS2 How to backtest using tick data with Metatrader 4

Review TDS2 How to backtest using tick data with Metatrader 4 in this Review TDS2…

8 years ago

This website uses cookies.