Home / How To / How to install the web-based Guacamole Remote Desktop Client on Ubuntu 18.04 LTS

How to install the web-based Guacamole Remote Desktop Client on Ubuntu 18.04 LTS



If you are a system administrator and responsible for managing Windows and Linux machines, you may often need remote desktop client software to manage them. Apache Guacamole is a free, open source and web-based remote desktop application that lets you access your desktop machines through a web browser. It is a clientless HTML5 web application that supports standard protocols such as VNC, RDP and SSH. You do not need to install and client software or plugins on the server. With Guacamole, you can easily switch between multiple remote desktop machines with the same browser window.

In this tutorial we will show how to install Apache Guacamole Remote Desktop Port on Ubuntu 18.04 LTS server.

Prerequisites

  • A server running Ubuntu 18.04.
  • A root password is set on your server.

Getting Started

Before you begin, it is a good idea to update the system package to the latest version. You can update them with the following command:

  apt-get update -y 
apt-get upgrade -y

After all packages have been updated, restart the system to apply the changes.

Install Required Dependencies

Before you begin, you must install some dependencies on your system to compile Guacamole from the source. You can install all with the following command:

  apt-get install gcc-6 g ++ - 6 libossp-uuid-dev libavcodec-dev libpango1.0-dev libssh2-1-dev libcairo2-dev libjpeg-turbo8-dev libpng -dev libavutil-dev libswscale-dev libfreerdp-dev libvncserver-dev libssl-dev libvorbis-dev libwebp-dev -y 

Once all packages are installed, you can proceed to the next step.

Installing Tomcat Server

Next, you must install Tomcat on your server to serve guacamole client content to users who connect to the guacamole server through the browser. You can install it with the following command:

  apt-get install tomcat8 tomcat8-admin tomcat8-common tomcat8-user -y 

Once Tomcat is installed, you can proceed to the next step.

Installing Guacamole Server

Guacamole is divided into two components, guacamole server providing guacd proxy and related libraries, and guacamole client providing the client to be served by your Tomcat server. By default, Guacamole Server is not available in the Ubuntu 18.04 standard repository. So you have to build it from the source.

First, download the latest version of the Guacamole source with the following command:

  wget http: // apachemirror. wuchna.com/guacamole/1.1.0/source/guacamole-server-1.1.0.tar.gzebrit19659009??When the download is complete, extract the downloaded file with the following command: 

  tar -xvzf guacamole-server -1.1. 0.tar.gz 

Then change the directory to the extracted directory and configure it with the following command:

  cd guacamole-server-1.1.0 
./ configure --with-init -dir = / etc / init.d

When the configuration is successful, you should get the following output:

     Library status:

freerdp2 ............ no
pango ............... yes
libavcodec .......... yes
libavutil ........... yes
libssh2 ............. yes
libssl .............. yes
libswscale .......... yes
libtelnet ........... no
libVNCServer ........ yes
libvorbis ........... yes
libpulse ............ no
libwebsockets ....... no
libwebp ............. yes
wsock32 ............. no

Protocol Support:

Kubernetes .... no
RDP ........... no
SSH ........... yes
Telnet ........ no
VNC ........... yes

Services / Tools:

guacd ...... yes
guacenc .... yes
guaclog .... yes

FreeRDP plugins: no
Init script: /etc/init.d
System D devices: no

Type "make" to compile guacamole server.

Then run the following command to compile guacamole server:

  make 

When compilation is complete, you can install it with the following command:

  does installation 

Once installed, run the following command to update the system's installed library cache

  ldconfig 

Then enable the Guacamole service to start at startup and start it with the following command: [19659008] systemctl enable guacd
systemctl start guacd

You can also check the status of the Guacamole service with the following command:

  systemctl status guacd 

You should get the following output:

? guacd.service - LSB: Guacamole proxy demon
Loaded: loaded (/etc/init.d/guacd; generated)
Active: active (running) since Sat 2020-04-11 14:48:03 UTC; 7s ago
Document: man: systemd-sysv generator (8)
Process: 28833 ExecStart = / etc / init.d / guacd start (code = terminated, status = 0 / SUCCESS)
Details: 1 (limit: 2359)
CGroup: /system.slice/guacd.service
?? 28847 / usr / local / sbin / guacd -p /var/run/guacd.pid

Apr 11 14:48:03 ubuntu1804 systemd [1]: Launch LSB: Guacamole proxy daemon ...
April 11 14:48:03 ubuntu1804 guacd [28834]: Guacamole proxy daemon (guacd) version 1.1.0 started
Apr 11 14:48:03 ubuntu1804 guacd [28833]: Start guacd: guacd [28834]: INFO: Guacamole proxy daemon (guacd) version 1.1.0 started
Apr 11 14:48:03 ubuntu1804 guacd [28833]: SUCCESS
Apr 11 14:48:03 ubuntu1804 systemd [1]: Started LSB: Guacamole proxy daemon.
Apr 11 14:48:03 ubuntu1804 guacd [28847]: Listening to host 127.0.0.1, port 4822

Installing the Guacamole Client

Next, you must install the Guacamole client on your server. The Guacamole client is written in Java and is platformed. This will be the final HTML5 application that will be presented to you.

First download the Guacamole binary with the following command:

  wget https://mirrors.estointernet.in/ apache / guacamole / 1.1.0 / binary / guacamole-1.1.0.warebrit19659009 ?? When the download is complete, copy it to / etc / guacamole directory: 

  mkdir / etc / guacamole 
etc. guacamole-1.1.0 .war /etc/guacamole/guacamole.warebrit19659009uutNext, create a symbolic link to the guacamole client to the Tomcat webapp directory with the following command:

  ln-s /etc/guacamole/guacamole.war / var / lib / tomcat8 / webapps / 

Finally, restart Tomcat and Guacamole to deploy the new web application

  systemctl restart tomcat8 
systemctl restart guacd

Configure Guacomole

After installing Guacamole, you must be able to configure users and connections work with Guacamole prope rly. Ads

First, create a Guacamole master configuration file named guacamole.properties.

  nano / etc / guacamole / guacamole .properties 

Add the following lines:

 guacd-hostname: localhost
guacd port: 4822
user mapping: /etc/guacamole/user-mapping.xml

Save and close the file. Then create a lib and extension directory with the following command:

  mkdir / etc / guacamole / {extensions, lib} 

Next, guacamole home directory environment variable for tomcat8 default configuration file.

  echo "GUACAMOLE_HOME = / etc / guacamole" >> / etc / default / tomcat8 

Guacamole's default authentication method reads all users and connections from a single file called user-mapping.xml. This file will define the user accessing the Guacamole web interface, the servers to connect to and the connection method.

First generate md5 hash for the password with the following command:

  echo -n yourecurepassword | openssl md5 

You should get the following output:

 (stdin) = 55b38b03e7587a45fd886977842ff9b8

Note: Remember this hash, you must specify it in the user-mapping.xml file.

Then create a new user-mapping.xml with the following command:

  nano / etc / guacamole / user-mapping.xml 

Add the following lines: Ads

 




 ssh [19659073] 192.168.0.150 [19659074] root [19659075] root [19659076] RDP [19659073] 192.168.0.100 [19659074] 3389 






Save and close the file when you are done. Then restart Tomcat and the Guacamole service to apply the changes:

  systemctl restart tomcat8 
systemctl restart guacd

Access Guacamole Web Interface

At this point, the Guacamole server is installed and configured. Now it's time to access it through a web browser.

Open your browser and enter the URL http: // your-server-ip: 8080 / guacamole / . You will be redirected to the Apache Guacamole login page:

 Guacamole Login

Enter the username and password that you entered in the user-mapping.xml file and click Log in - button. You should see Apache Guacamole default panel with all connections:

 Latest connections

Now click on the Ubuntu server and you will be prompted to enter the password of the user that you defined in the user-mapping.xml displayed below:

 Shell Login

Enter your system user password and enter Enter . You log in to the Ubuntu server shown below:

 Successfully logged in to server

Configure Nginx as a reverse proxy for Guacamole

Then you must configure Nginx as a reverse proxy to access the Guacamole dashboard . First, install the Nginx web server with the following command:

  apt-get install nginx-y 

After you install a new Nginx virtual host configuration file:

  nano / etc / nginx / sites-available / guacamole.conf [19659009] Add the following lines: 

 server {
listen 80;
server-name your-server-ip;
access_log /var/log/nginx/guac_access.log;
error_log /var/log/nginx/guac_error.log;

location / {
proxy_pass http: // your-server-ip: 8080 / guacamole /;
proxy_buffering of;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
proxy_set_header Upgrade $ http_upgrade;
proxy_set_header Connection $ http_connection;
proxy_cookie_path / guacamole / /;
}

}

Save and close the file when you are done. Then enable the Nginx virtual host with the following command:

  ln -s /etc/nginx/sites-available/guacamole.conf / etc / nginx / sites-enabled / 

Next, check Nginx for syntax errors with the following command:

  nginx -t 

You should get the following output:

 nginx: configuration file /etc/nginx/nginx.conf syntax is ok
nginx: The /etc/nginx/nginx.conf test configuration file is successful

Finally, restart the Nginx service to apply the changes:

  systemctl restart nginx 

Now you can access the Guacamole web interface with URL: http: // your-server-ip.

Conclusion [19659007] Congratulations! you have installed the Guacamole Remote Desktop Gateway on Ubuntu 18.04 server. You can now add another remote server that you want to manage remotely through a web browser.


Source link