Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lyuehh/edb8b704e2627d7318c24d729a191f4a to your computer and use it in GitHub Desktop.
Save lyuehh/edb8b704e2627d7318c24d729a191f4a to your computer and use it in GitHub Desktop.
guacamole install on ubuntu 18.04
# install required packages
apt -y update
add-apt-repository ppa:webupd8team/java
apt -y update
apt -y install libcairo2-dev libjpeg-turbo8-dev libpng-dev libossp-uuid-dev libfreerdp-dev libpango1.0-dev libssh2-1-dev libtelnet-dev \
libvncserver-dev libpulse-dev libssl-dev libvorbis-dev libwebp-dev git build-essential autoconf libtool oracle-java8-installer tomcat8 \
tomcat8-admin tomcat8-common tomcat8-docs tomcat8-user maven postgresql-server-dev-9.5 postgresql-common postgresql-9.5 libpulse-dev \
libvorbis-dev freerdp ghostscript wget pwgen
# create directories & files
mkdir -p /etc/guacamole
mkdir -p /etc/guacamole/lib
mkdir -p /etc/guacamole/extensions
touch /etc/guacamole/user-mapping.xml
# configure GUACAMOLE_HOME for tomcat
echo "" >> /etc/default/tomcat8
echo "# GUACAMOLE ENV VARIABLE" >> /etc/default/tomcat8
echo "GUACAMOLE_HOME=/etc/guacamole" >> /etc/default/tomcat8
cd /opt
# install guacamole server
git clone https://github.com/apache/incubator-guacamole-server.git
cd incubator-guacamole-server/
autoreconf -fi
./configure --with-init-dir=/etc/init.d
make && make install
ldconfig
systemctl enable guacd
# install guacamole client (web app)
cd /opt
git clone https://github.com/apache/incubator-guacamole-client.git
cd incubator-guacamole-client
mvn package
cp ./guacamole/target/guacamole-0.9.12-incubating.war /var/lib/tomcat8/webapps/guacamole.war
cp ./extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/target/guacamole-auth-jdbc-postgresql-0.9.12-incubating.jar /etc/guacamole/extensions/
#cp ./extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/target/guacamole-auth-jdbc-mysql-0.9.12-incubating.jar /etc/guacamole/extensions/
#cp ./extensions/guacamole-auth-ldap/target/guacamole-auth-ldap-0.9.12-incubating.jar /etc/guacamole/extensions/
# install postgresql connector
cd /usr/local/src
wget -c https://jdbc.postgresql.org/download/postgresql-42.0.0.jar
cp postgresql-42.0.0.jar /etc/guacamole/lib/
ln -s /usr/local/lib/freerdp/* /usr/lib/x86_64-linux-gnu/freerdp/.
# install mysql connector
#wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.tar.gz
#tar xf mysql-conn*
#cp mysql-connector-java-5.1.40/mysql-connector-java-5.1.40-bin.jar /etc/guacamole/lib/
#ln -s /usr/local/lib/freerdp/* /usr/lib/x86_64-linux-gnu/freerdp/.
# generate password
pwgen -n 14
# configure guacamole properties
echo "#api-session-timeout: 60" >> /etc/guacamole/guacamole.properties
echo "available-languages: en" >> /etc/guacamole/guacamole.properties
echo "guacd-hostname: localhost" >> /etc/guacamole/guacamole.properties
echo "guacd-port: 4822" >> /etc/guacamole/guacamole.properties
echo "#guacd-ssl: true" >> /etc/guacamole/guacamole.properties
echo "lib-directory: /var/lib/tomcat8/webapps/guacamole/WEB-INF/classes" >> /etc/guacamole/guacamole.properties
#echo "auth-provider: net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider" >> /etc/guacamole/guacamole.properties
#echo "basic-user-mapping: /etc/guacamole/user-mapping.xml" >> /etc/guacamole/guacamole.properties
# configure postgresql for guacamole
echo "" >> /etc/guacamole/guacamole.properties
echo "postgresql-hostname: localhost" >> /etc/guacamole/guacamole.properties
echo "postgresql-port: 5432" >> /etc/guacamole/guacamole.properties
echo "postgresql-database: guacamole_db" >> /etc/guacamole/guacamole.properties
echo "postgresql-username: guacamole_user" >> /etc/guacamole/guacamole.properties
echo "postgresql-password: PASSWORD" >> /etc/guacamole/guacamole.properties
echo "postgresql-user-password-min-length: 8" >> /etc/guacamole/guacamole.properties
echo "postgresql-user-password-require-multiple-case: true" >> /etc/guacamole/guacamole.properties
echo "postgresql-user-password-require-symbol: true" >> /etc/guacamole/guacamole.properties
echo "postgresql-user-password-require-digit: true" >> /etc/guacamole/guacamole.properties
echo "postgresql-user-password-prohibit-username: true" >> /etc/guacamole/guacamole.properties
# configure mysql for guacamole
#echo "mysql-hostname: localhost" >> /etc/guacamole/guacamole.properties
#echo "mysql-port: 3306" >> /etc/guacamole/guacamole.properties
#echo "mysql-database: guacamole_db" >> /etc/guacamole/guacamole.properties
#echo "mysql-username: guacamole_user" >> /etc/guacamole/guacamole.properties
#echo "mysql-password: PASSWORD" >> /etc/guacamole/guacamole.properties
# link guacamole dir to tomcat
rm -rf /usr/share/tomcat8/.guacamole
ln -s /etc/guacamole /usr/share/tomcat8/.guacamole
service tomcat8 restart
# postgresql provision the guacamole database
cd /opt/incubator-guacamole-client/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/
su postgres -
createdb guacamole_db
cat schema/*.sql | psql -d guacamole_db -f -
psql -d guacamole_db
CREATE USER guacamole_user WITH PASSWORD 'PASSWORD';
GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA public TO guacamole_user;
GRANT SELECT,USAGE ON ALL SEQUENCES IN SCHEMA public TO guacamole_user;
\q
# mysql provision the guacamole database
#mysql -u root -pMYSQLROOTPASSWORD
#create database guacamole_db;
#create user 'guacamole_user'@'localhost' identified by 'PASSWORD';
#GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
#flush privileges;
#quit
#cat /opt/incubator-guacamole-client/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/*.sql | mysql -u root \
-pMYSQLROOTPASSWORD guacamole_db
# TODO: include instructions for ldap integration
systemctl restart guacd
# guacd: /usr/local/sbin/guacd: error while loading shared libraries: libguac.so.12: cannot open shared object file: No such file
ldconfig
systemctl restart guacd
systemctl restart tomcat8
# default login
http://IP-ADDRESS:8080/guacamole/
guacadmin/guacadmin
# http://IP-ADDRESS:8080/guacamole/ slow to load?
apt-get install -y haveged
# nginx:
apt-get install -y nginx
mkdir /etc/nginx/ssl
cd /etc/nginx/ssl
# This is going to take a long time
openssl dhparam -out dhparams.pem 2048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment