Thursday, February 20, 2020

Guacamole Setup on CentOS 7

Here is a step by step guide how to install and configure Apache Guacamole on CentOS7

Step 1. Of course, you need to install a new system. During the installation, remember to set few things to avoid manual change later.

- set time zone
- set network configuration
- set storage
- select minimal server packages
- begin installation
- set root password


Step 2. After installation reboot, it's a good practice to keep your system up-to-date.


# yum update -y


Reboot


Step 3. Install some dependency packages.  The following list all packages to be installed. 

# yum install -y cairo-devel
# yum install -y libjpeg-turbo-devel
# yum install -y libpng-devel
# yum install -y libtool
# yum install -y uuid-devel


# yum install epel-release
# rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
# yum install -y ffmpeg-devel
# yum install -y freerdp-devel
# yum install -y pango-devel
# yum install -y libssh2-devel
# yum install -y libtelnet-devel
# yum install -y libvncserver-devel
# yum install -y libwebsockets-devel
# yum install -y pulseaudio-libs-devel
# yum install -y openssl-devel
# yum install -y libvorbis-devel
# yum install -y libwebp-devel

Step 4. Download Apache Guacamole Server source and get it install

you might need this tool.
# yum install -y wget


Download Source (2 ways)

download from website http://guacamole.apache.org or from github

download from website

after getting the url from browser download manager, you can download with wget ( for me, i have the url)


# wget http://apache.communilink.net/guacamole/1.1.0/source/guacamole-server-1.1.0.tar.gz
# tar -xzf guacamole-server-1.1.0.tar.gz
# cd guacamole-server-1.1.0/

download from github

# git clone git://github.com/apache/guacamole-server.git
# cd guacamole-server/
# autoreconf -fi
# ./configure --with-init-dir=/etc/init.d


You should get similar result


# make
# make install
# ldconfig

Now the Guacamole Server is ready.

Step 5. Download Apache Guacamole Client WAR

Download client from website


after getting the url from browser download manager, you can download with wget ( for me, i have the url)
# wget http://ftp.cuhk.edu.hk/pub/packages/apache.org/guacamole/1.1.0/binary/guacamole-1.1.0.war

Step 6. Install Tomcat


# yum install -y tomcat
# yum install -y tomcat-admin-webapps
# yum install -y tomcat-webapps


# vi /usr/share/tomcat/conf/tomcat-users.xml
Uncomment these lines and change the password for admin

<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user name="admin" password="**********" roles="admin,manager,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" />
</tomcat-users>





# systemctl enable tomcat
# systemctl restart tomcat

Step 7. Open port 8080 on firewall

# firewall-cmd --add-port=8080/tcp --permanent
# firewall-cmd --reload


now your tomcat should be available
http://:8080/
mine is http://10.10.10.13:8080/


and the manager app should also work at http://10.10.10.13:8080/manager/html
After input the admin user name and  password,


# cp guacamole-1.1.0.war /usr/share/tomcat/webapps/guacamole.war


Then refresh the http://10.10.10.13:8080/manager/html
You will see the app deployed


# mkdir /etc/guacamole
# vi /etc/guacamole/guacamole.properties
# Hostname and port of guacamole proxy
guacd-hostname: localhost
guacd-port:     4822


# vi /etc/guacamole/user-mapping.xml
(this is for testing purpose, change the red parts as needed)

<user-mapping>

   <authorize
            username="testuser"
            password="testpass123">

        <connection name="VNC TEST”>
            <protocol>vnc</protocol>
            <param name="hostname">172.16.10.10</param>
            <param name="port">5900</param>
            <param name="password">******</param>
        </connection>

        <connection name="SSH TEST">
            <protocol>ssh</protocol>
            <param name="hostname">10.10.10.25</param>
            <param name="port">22</param>
        </connection>

        <connection name="RDP TEST">
            <protocol>rdp</protocol>
            <param name="hostname">172.16.10.19</param>
            <param name="port">3389</param>
        </connection>

    </authorize>

</user-mapping>


# systemctl enable guacd
# systemctl restart tomcat guacd


Step 8.  Testing - without Database

http://10.10.10.13:8080/guacamole


Try to click any of connections for testing 
During session connected, you can use CTRL+ALT+SHIFT to call the GUACAMOLE menu for disconnections (under top right corner choose testuser->disconnect)