Skip to main content

Install Apache Guacamole on Ubuntu 22.04

 

Install Apache Guacamole on Ubuntu 22.04

Apache Guacamole Installation Guide

Remote Desktop Gateway for Ubuntu 22.04

Ubuntu 22.04 Remote Desktop

What is Apache Guacamole?

Apache Guacamole is a clientless remote desktop gateway that supports standard protocols like VNC, RDP, and SSH. Thanks to HTML5, once Guacamole is installed on a server, all you need to access your desktops is a web browser.

Clientless

No plugins or client software needed

Secure

Supports SSL/TLS encryption

Multi-protocol

RDP, VNC, SSH all in one place

Prerequisites

  • Ubuntu 22.04 server with root or sudo privileges
  • At least 2GB RAM (4GB recommended for production)
  • Minimum 10GB disk space
  • Domain name pointing to your server (recommended)

Installation Steps

1

Update System Packages

Before installing any new software, it's good practice to update your system packages.

sudo apt update && sudo apt upgrade -y
2

Install Dependencies

Guacamole requires several dependencies including Java, Tomcat, and others.

sudo apt install -y make gcc g++ libcairo2-dev libjpeg-turbo8-dev libpng-dev \
libtool-bin libossp-uuid-dev libavcodec-dev libavformat-dev libavutil-dev \
libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev \
libvncserver-dev libwebsockets-dev libpulse-dev libssl-dev libvorbis-dev \
libwebp-dev tomcat9 tomcat9-admin tomcat9-user

Note: This installs a large number of packages required for Guacamole's various features.

3

Install Guacamole Server

Download and compile the Guacamole server from source.

wget https://downloads.apache.org/guacamole/1.5.0/source/guacamole-server-1.5.0.tar.gz
tar -xzf guacamole-server-1.5.0.tar.gz
cd guacamole-server-1.5.0
./configure --with-init-dir=/etc/init.d
make
sudo make install
sudo ldconfig

Warning: The compilation process may take several minutes depending on your server's resources.

4

Install Guacamole Client

Download and install the Guacamole web application.

sudo mkdir -p /etc/guacamole/{extensions,lib}
wget https://downloads.apache.org/guacamole/1.5.0/binary/guacamole-1.5.0.war
sudo mv guacamole-1.5.0.war /var/lib/tomcat9/webapps/guacamole.war
sudo systemctl restart tomcat9
5

Configure Guacamole

Create configuration files for Guacamole.

sudo nano /etc/guacamole/guacamole.properties

Add the following content:

# Hostname and port of guacamole proxy
guacd-hostname: localhost
guacd-port: 4822

# MySQL properties
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole_db
mysql-username: guacamole_user
mysql-password: your_password_here
sudo nano /etc/tomcat9/Catalina/localhost/guacamole.xml

Add the following content:

<Context path="/guacamole" docBase="/var/lib/tomcat9/webapps/guacamole.war">
  <Parameter name="guacamole-home" value="/etc/guacamole"/>
</Context>
6

Install and Configure MySQL

Guacamole requires a database for authentication and storing connections.

sudo apt install -y mysql-server

Secure MySQL installation:

sudo mysql_secure_installation

Create database and user:

sudo mysql -u root -p
CREATE DATABASE guacamole_db;
CREATE USER 'guacamole_user'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost';
FLUSH PRIVILEGES;
exit

Import the schema:

wget https://downloads.apache.org/guacamole/1.5.0/binary/guacamole-auth-jdbc-1.5.0.tar.gz
tar -xzf guacamole-auth-jdbc-1.5.0.tar.gz
sudo cp guacamole-auth-jdbc-1.5.0/mysql/guacamole-auth-jdbc-mysql-1.5.0.jar /etc/guacamole/extensions/
cat guacamole-auth-jdbc-1.5.0/mysql/schema/*.sql | sudo mysql -u root -p guacamole_db
7

Start Services

Start and enable the Guacamole and related services.

sudo systemctl start guacd
sudo systemctl enable guacd
sudo systemctl restart tomcat9
sudo systemctl restart mysql
8

Access Guacamole Web Interface

Guacamole should now be accessible via your web browser.

Default Login:

Username: guacadmin

Password: guacadmin

Change this password immediately after first login!

http://your_server_ip:8080/guacamole

Post-Installation Security

Change Default Credentials

Immediately change the default guacadmin password after first login.

Setup SSL/TLS

Configure Nginx or Apache as a reverse proxy with Let's Encrypt SSL certificate.

Create Additional Users

Create individual user accounts instead of sharing the admin account.

Troubleshooting

Guacamole not loading

Check Tomcat logs: sudo tail -f /var/log/tomcat9/catalina.out

Connection issues

Verify guacd is running: sudo systemctl status guacd

Database errors

Check MySQL logs: sudo tail -f /var/log/mysql/error.log

Comments

Popular posts from this blog

Configuring Multipathing and Setting Up Storage on a Linux Server:

Ensuring high availability and redundancy in your storage environment is crucial for maintaining system reliability. Multipathing allows you to distribute I/O across multiple paths, providing fault tolerance and improved performance. This guide covers the entire process from configuring multipathing to setting up physical volumes (PVs), volume groups (VGs), and logical volumes (LVs) with different sizes.  Prerequisites:   Before you begin, make sure you have the following:  Administrative access to the server  Multipath tools installed on your server  Basic understanding of Linux commands  Step-by-Step Guide:   1. Install Multipath Tools:   Ensure that you have the necessary multipath tools installed: # sudo yum install device-mapper-multipath yum: Package manager for RHEL-based distributions.  install: Command to install a package.  device-mapper-multipath: Name of the package to be installed.  2. Enable and Start t...

Configure SSH Between Compute Nodes in OpenStack:

To perform operations like live migration or resizing an instance between compute nodes in OpenStack, SSH key-based authentication must be configured between all the nodes. This ensures smooth communication for moving instance disks without encountering errors like "Permission denied." Follow these steps to configure SSH between compute nodes:  Step 1: Obtain or Generate SSH Key Pair: On the first compute node, either use the existing SSH key pair located in /root/.ssh/id_rsa (private key) and /root/.ssh/id_rsa.pub (public key) , or generate a new key pair if none exists: # ssh-keygen -t rsa -b 2048 This will create a private key (id_rsa) and a public key (id_rsa.pub) in the .ssh directory.  Step 2: Disable SELinux (Optional): If you are using SELinux, switch to permissive mode temporarily to avoid permission issues: # setenforce 0 Step 3: Enable Login for the nova User: Ensure that the nova user has shell access: # usermod -s /bin/bash nova Switch to the nova user...

What is the OSI Model, and how does it work?

  What is the OSI Model, and how does it work? OSI - Open Systems Interconnection                1. The Open Systems Interconnection (OSI) model is a virtual model for describing the internal structure and technologies of a computer system.                2. Network communication is divided into seven tiers according to the OSI Model. These layers are helpful in detecting network problems.                3. A lot of unneeded work can be avoided if the problem can be focused down to one specific layer of the model. Seven layers of the OSI Model 7. Application layer                1. In the OSI model, the Application Layer is the layer closest to the end user.                2. It receives data directly from users and shows the information to them.           ...