Changes

From Amahi Wiki
Jump to: navigation, search
5,695 bytes added ,  03:38, 18 June 2017
{{MessageBox|backgroundcolor = #faa|image =Warning.png|heading =WARNING|message =This is recommended only for advanced users, proceed with caution.}}= What is Guacamole? == [https://guacamole.incubator.apache.org/ Guacamole ] is an HTML5 remote desktop gatewaythat can be installed on Amahi 9 (Fedora 23). This guidance may work with other Amahi versions with some modification.
Guacamole provides access to desktop environments using remote desktop protocols like VNC and RDP. A centralized server acts as a tunnel and proxy, allowing access to multiple desktops through a web browser.
No browser plugins are needed, and no client software needs to be installed. The client requires nothing more than a web browser supporting HTML5 and AJAX.
== Installing Guacamole on Amahi ===== Dependencies ===*tomcat6 *libvncserver *freerdp (This is official on the Guacamole siteREF: [http://www. Fedora 14 will not support Freerdp 1tecmint.0 or higher, thus RDP protocol in com/guacamole-access-remote-linux-windows-machines-via-web-browser/ Setting Up Web-Based Guacamole is not available. Leave freerdp out of the code below if you are running Fedora 14.)*libvorbisTool to Access Remote Linux/Windows Machines]
In terminal, = Install Guacamole =<div style="border: 1px solid #A3B1BF; padding: .8em 1em; background-color: #E6F2FF; margin: 0px 1em;">'''WARNING:''' All commands in this tutorial are executed as <code>root, install dependencies </code> (or precede with the following:<code>sudo</code>).</div>
{{Code|
Code = $ su
Password:
# yum install tomcat6 libvncserver freerdp libvorbis
}}
We have created a bash script to make installation simple or you can manually install using the guidance below. You '''MUST''' complete the [[Guacamole#Create Amahi Web App|Create Amahi Web App]] step prior to executing the following: wget <nowiki>https://www.dropbox.com/s/4hadafih8ahuj2n/install-guacamole.sh</nowiki> chmod 755 install-guacamole.sh ./install-guacamole.sh Do NOT use this script on anything less than Amahi 9 / Fedora 23 unless you edit it first to match your systems' requirements. (See [[Guacamole#Install Dependencies|Install Dependencies]] to learn what changes are necessary.) === Preparing Create Amahi =Web App ==Login to your Amahi Dashboard and choose "Set Up" install the Amahi [https://www.amahi.org/apps/web-apps Web Apps] plug-in the upper right.Ensure you '''enable''' [[Advanced Settings]]. 
Now select the "Apps" tab.
Click on "Webapps" and on the page that comes up choose the "New Web App" button at the bottom.
Fill in the name (guacamole) and leave everything else as it is.
Edit ''####-guacamole.conf'' in '''/etc/httpd/conf.d''' (replacing #### with the appropriate number): vi /etc/httpd/conf.d/####-guacamole.conf Right below the ''ServerAlias'' line, add the following: ProxyPass / <nowiki>http://localhost:8080/guacamole/</nowiki> ProxyPassReverse / <nowiki>http://localhost:8080/guacamole/</nowiki> Again, if you use vi for creating this file, press the <i>Esc</i> key to get back in command mode and <i>:wq</i> to write the changes and quit vi. Restart Apache systemctl restart httpd ==Install Dependencies == Downloading Due to the Fedora 23 ''freerdp'' packages being unstable, we must use the CentOS stable version. (Do not do this if you are installing on Fedora 21 or below) To install, execute the Binary Packages following:<pre>wget https://www.dropbox.com/s/p2uc1rcpckky75v/libxkbfile-1.0.8-5.el7.x86_64.rpmwget https://www.dropbox.com/s/0tjm7q93z9pw0hj/freerdp-libs-1.0.2-6.el7_2.1.x86_64.rpmwget https://www.dropbox.com/s/aysml7coehz0hqi/freerdp-devel-1.0.2-6.el7_2.1.x86_64.rpmrpm -Uvh libxkbfile-1.0.8-5.el7.x86_64.rpmrpm -Uvh freerdp-libs-1.0.2-6.el7_2.1.x86_64.rpmrpm -Uvh freerdp-devel-1.0.2-6.el7_2.1.x86_64.rpm</pre>  Now install the Fedora dependencies:For Fedora 23 or newer (Fedora 21, substitute <code>yum</code> for <code>dnf</code> and add <code>freerdp-devel</code> to the list of dependencies): dnf install tomcat gcc cairo-devel libjpeg-devel libpng-devel uuid-devel pango-devel \ libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel \ libvorbis-devel libwebp-devel dejavu-sans-mono-fonts terminus-fonts terminus-fonts-console == Configure MySQL Authentication ===== Install MySQL Authentication Module ===Go to Create a working directory and move there mkdir -p /var/hda/web-apps/guacamole/sqlauth && cd /var/hda/web-apps/guacamole/sqlauth Download Guacamole's authorization module wget <nowiki>http://guacsourceforge.net/projects/guacamole/files/current/extensions/guacamole-auth-jdbc-0.9.9.tar.gz</nowiki> Unpack it tar -zxf guacamole-auth-jdbc-0.9.9.tar.gz Download MySQL and Java Connector wget <nowiki>http://dev.orgmysql.com/get/Downloads/Connector/j/mysql-connector-java-5.1.38.tar.gz</nowiki> Unpack it tar -zxf mysql-connector-java-5.1.38.tar.gz Create directories for the extensions in Tomcat's folders mkdir -p /usr/share/tomcat/.guacamole/{extensions,lib} Move the modules to their respective directories. mv guacamole-auth-jdbc-0.9.9/mysql/guacamole-auth-jdbc-mysql-0.9.9.jar /usr/share/tomcat/.guacamole/extensions/ mv mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar /usr/share/tomcat/.guacamole/lib/  Restart MariaDB systemctl restart mariadb === Create the Database === hda-create-db-and-user guacdb === Configure Database Settings ===Create a directory for the configuration file. mkdir -p /etc/guacamole/ Create a file called "guacamole.properties" in that directory vi /etc/guacamole/guacamole.properties Press the <i>i</ i> key to begin inserting text into the guacamole.properties file and choose from include the table following contents: # MySQL properties mysql-hostname: localhost mysql-port: 3306 mysql-database: guacdb mysql-username: guacdb mysql-password: guacdb # Additional settings mysql-default-max-connections-per-user: 0 mysql-default-max-group-connections-per-user: 0 If you use vi for creating this file, press the binary packages <i>Esc</i> key to get back in command mode and <i>:wq</i> to write the changes and quit vi. Now create a symbolic link of this file for Tomcat ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat/.guacamole/ === Load Guacamole Data ===The schema for your systemMySQL was downloaded in the previous process. Just change directories to the files location For cd /var/hda/web-apps/guacamole/sqlauth/guacamole-auth-jdbc-0.9.9/mysql/schema/ and run the following command: cat ./*.sql | mysql -uroot -p guacdb ::'''Fedora 14WARNING:''' Please see [[Database Root Password]] for the appropriate login password. == Install Guacamole Server ==Guacamole uses "guacd", I chose a Guacamole server and a Guacamole Client for users to connect to the "guacd" server. We first install Guacamole Server. Change Directories cd /var/hda/web-apps/guacamole Download Guacamole Server wget <nowiki>https://sourceforge.net/projects/guacamole/files/current/source/guacamole-server-0.9.9.tar.gz</nowiki> Unpackage it tar -xzf guacamole-server-0.9.9.tar.gz Move to the Guacamole source code directory cd guacamole-server-0.9.9/ Configure, make and install it. ./configure --with-init-dir=/etc/init.d make make install ldconfig == Install Guacamole Client ==Create a new directory and move to it. mkdir -p /var/lib/guacamole && cd /var/lib/guacamole/ Download Guacamole Client. wget <nowiki>http://sourceforge.net/projects/guacamole/files/current/binary/guacamole-0.9.9.war -O guacamole.war</nowiki> Create a symbolic link of the file for Tomcat. ln -s /var/lib/guacamole/guacamole.war /var/lib/tomcat/webapps/ == Update Amahi Web App Files ==Create Symbolic links between guacamole in Tomcat and Amahi's web app directory ln -s /var/lib/tomcat/webapps/guacamole/* /var/hda/web-apps/guacamole/html Make sure the owner of all the file is ''apache''and the group is 'Fedora 15'users'' packages and they worked flawlessly. chown -R apache:users /var/hda/web-apps/guacamole == Start Guacamole Server ==Restart Tomcat. ​systemctl restart tomcat Start Guacamole Server. /etc/init.d/guacd start
=== Installing Configure Guacamole ===In terminal, change directories Server to where the packages downloaded and execute the following as root:{{Code|Code = # tar -xzf guacamole-0.8.0-fedora-15-i386.tar.gz# cd guacamole-0.8.0-fedora-15-i386/# rpm -i *start at boot.rpm}} systemctl enable tomcat*Be aware that you may have to adjust the above code to match the file name you downloaded. chkconfig guacd on
=== Setting up MySQL Authentication ==Log In to Guacamole ===== Making You can access the Directory ====As root, create web login screen for Guacamole from computers in the "classpath" directory{{Code|Code = mkdir network via '''<nowiki>http:/var/lib****:8080/guacamole</classpath}}nowiki>''' (Where the ''****'' is the IP address of your Amahi server).
==== Installing MySQL Authentication Module ====Download the MySQL Authentication Modulehttp:The default user name/password is ''guacadmin''/sourceforge''guacadmin''.net/projects/guacamole/files/current/extensions/guacamole-auth-mysql-0.8.0You can change your password by editing your own user in the administration screen.tar.gz/download
Move = Access Outside the Network =If you want Guacamole's web interface to be accessible outside of your LAN you will have to forward a random, unused port (1111, for example) to the directory containing the download and unpack the downloadport 8080 in your router.
{{Code|Code = # tar -xzf Then when you access Guacamole from outside your LAN you will need to add ''/guacamole-auth-mysql-0'' to the end of your url.8(<nowiki>http://servername.0yourhda.tar.gz}}*Be aware that you may have to adjust the above code to match the file name you downloadedcom:1111/guacamole</nowiki>).
Copy all of the ".jar" files in the If you do not add ''/lib of the downloaded file guacamole'' to the classpath directory your url, you created.{{Code|Code = cp -r /whereever/will see a blank page since you did not specify which application in Tomcat you/downloaded/it/guacamole-auth-mysql-0.8wanted to access.0/lib/*.jar /var/lib/guacamole/classpath}}
You need one more ".jar" file that The safest and most secure method to access Guacamole is not included (MySQL Connector-J). You can get it here: httpusing [https://devwww.mysqlamahi.comorg/downloads/connector/japps/openvpn OpenVPN] and an [[OpenVPN_clients|OpenVPN client]] from a smart phone, tablet, or computer.
Move to the directory containing the download and unpack the download= Making Preset Connections in Guacamole =
{{Code|Code = # tar -xzf mysql-connector-java-5.1.25.tar.gz}}*Be aware In Guacamole, an administrative User can create Connections that you may have will be available to adjust the above code to match the file name you downloadedGuacamole users.
== Enabling RDP in Windows Home and Basic Editions ==
"Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft, which provides a user with a graphical interface to connect to another computer over a network connection." ''1''
Copy mysql-connector-java-5.1.23-bin.jar to the classpath directory If you created.{{Code|Code = cp -r /whereever/do not have Windows pro or ultimate versions you/downloaded/it/mysql-connector-java-5.1.25/mysql-connector-java-5.1.23-binhave to run a patch that activates RDP.jar /var/lib/guacamole/classpath}}
==== Making the MySQL Tables ====Now we need RDP Wrapper Library is an option for enabling RDP features. (Use this at your own risk. Please read RDP Wrapper Library literature and follow directions to install. Any problems are to create a MySQL Table that Guacamole can usebe addressed with RDP Wrapper Library support.){{Code|Code = $ mysql -u root -pEnter password https: default for Amahi is hdamysql> CREATE DATABASE guacamole;Query OK, 1 row affected (0//github.00 sec)com/stascorp/rdpwrap/releases
mysql> CREATE USER 'guacamole'@'localhost' IDENTIFIED BY 'some_password';Query OKIf you have Windows Professional or Ultimate, 0 rows affected you will need to "Allow Remote Access to Your Computer." (0A simple Internet search of this phrase with your Windows version offers many tutorials on this.00 sec)
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole== Guacamole RDP Connections to Windows Computers ==After you have login to Guacamole click on your login name in the upper right . In the drop-down menu choose "Settings." Click on the Connections tab on the settings page.* TO 'guacamole'@'localhost';Query OK, 0 rows affected (0Click the "New Connection" button.00 sec)
mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.02 sec)Below are some VERY basic settings for an RDP connection in Guacamole:
mysql> quitBye}}The database and user can be named Name: whatever you like, but these instructions will refer want to both as call it (One can put "guacamoleRDP". Naturally, you should choose a real password for your user rather than within the name so as to differentiate between connections types in the string "some_password" shown above.list) Location: ROOT Protocol: RDP
==== Running the SQL scripts ==== Maximum number of connections: 2 Maximum number of connections per user:2
Host Name: The SQL scripts that create fixed IP address of the database schema and default administrator user are included in the guacamole-auth-mysql-0.8.0 archive computer to which you downloaded within the schema/ directory. Change directories wished to the guacamole-auth-mysql-0.8connect.0 archive(For example ''192.{{Code|Code = cd /whereever/you/downloaded/it/guacamole-auth-mysql-0168.81.0/schema}}10'')
The scripts All the other settings are named such that left either blank or as they can be run in order with one command:{{Code|Code = $ cat schema/*were.sql | mysql -u root -p guacamoleEnter password: default for Amahi is hda$}}
==== Configuring Note: Using RDP, only one device at a time can be logged in under a specific user. If you are logging into a Windows computer by the user "Fred" by RDP using Guacamole to Use MySQL Authentication ====You , any other device signed in as "Fred" will need be logged out. The side effect is that, when using RDP, a technician (using Guacamole) and client (on their Window computer) cannot see the same active desktop simultaneously. As a workaround, one can set up a VNC and an RDP connection for each Windows computer. RDP can be quicker and more fluid so use RDP when working alone and VNC when one needs to edit /etc/guacamole/guacamolesee what is currently happening on a Users computer under their account.properties
Start at Special Note: Once settings are in place, users can click on their User Name in the line upper right corner and choose "# Hostname and port of guacamole proxyHome" from the drop-down menu to return to the home screen and replace everything below it with this:use pre-configured connections.
guacd-hostname: localhost== Guacamole VNC Connections to Computers == guacd-port: 4822 # Auth provider class "In computing, Virtual Network Computing (authenticates user/pass combination, needed if using VNC) is a graphical desktop sharing system that uses the provided login screenRemote Frame Buffer protocol (RFB) auth-provider: netto remotely control another computer.sourceforge.guacamole.net.auth.mysql.MySQLAuthenticationProvider basic-user-mapping: /etc/guacamole/user-mapping.xml # Location It transmits the keyboard and mouse events from one computer to read extra another, relaying the graphical screen updates back in the other direction, over a network.jar"''2''s from lib-directory: /var/lib/guacamole/classpath # MySQL properties mysql-hostname: localhost mysql-port: 3306 mysql-database: guacamole mysql-username: guacamole mysql-password: some_password
Use In order to connect through Guacamole to a client device by VNC, one needs to install VNC client software on the real password you chose when creating device and configure it to the MySQL database user's desired specifications. In this publication, we will use a Windows based client and UltraVNC software, though this is by no means prescriptive for the Guacamole database in place of the string "some_password" as shown aboveeveryone.
=== Deploying Guacamole VNC Connections to Windows Computers ===To deploy Guacamole, you must make two symbolic links: one effectively copying ====UltraVNC Settings for Windows====Be sure to install UltraVNC to run as a service on the web application (now located at /var/lib/guacamole/guacamoleclient system.war) into Once UltraVNC is installed on the directory Tomcat monitors for web application deploymentWindows computer, right-click on the system tray icon and choose "Admin Properties" from the other effectively copying the configuration file, guacamolemenu that comes up.properties, into Set the Tomcat's classpath, such that Guacamole can find it once it runs. This must be done as rootfollowing values:{{Code|Code = # ln -s /var/lib/guacamole/guacamole.war /var/lib/tomcat6/webapps# ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat6/lib}}
Restart Tomcat Display Number or Ports to use: Select Ports and set Main and Http so something specific (e.g. 5904, 5804){{Code|Code = service tomcat6 restart}} Authentication: Set both the VNC Password and the View-Only Password. (Write them down. You will need it later.)
Start Guacamole's service{{Code|Code = service guacd start}}Click "OK" and then give permission for the program to make changes to your system.
Now configure ====Guacamole Settings to Connect to the tomcat6 and guacd services Windows client====After logging in to run automaticallyGuacamole click on your login name in the upper right . In the drop-down menu choose "Settings." Click on the Connections tab on the settings page. Click the "New Connection" button.
{{Code|Code = # chkconfig tomcat6 on# # chkconfig guacd on}}Below are some VERY basic settings for a VNC connection in Guacamole:
== Configuring Guacamole and Amahi ==Create Symbolic links Name: whatever you want to call it (One can put "VNC" within the name so as to differentiate between guacamole connections types in Tomcat and Amahi's webapp directorythe list) Location: ROOT Protocol: VNC
{{Code| Maximum number of connections: 2Code = # ln -s /var/lib/tomcat6/webapps/guacamole/admin.xhtml /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/agpl-3.0-standalone.html /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/client.xhtml /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/guacamole-common-js /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/images /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/index.xhtml /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/layouts /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/META-INF /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/scripts /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/styles /var/hda/web-apps/guacamole/html# ln -s /var/lib/tomcat6/webapps/guacamole/WEB-INF /var/hda/web-apps/guacamole/html}} Maximum number of connections per user:2
Create Host Name: The fixed IP address of the computer to which you wished to connect.htaccess file (For example ''192.168.1.10'') Port: The Main port number which was set in /var/hda/web-apps/guacamole/htmlthe Windows UltraVNC client software (e.g. 5904).{{Code|Code = # cd /var/hda/web-apps/guacamole/html# gedit Password: The VNC Password set earlier in the Windows UltraVNC client software.htaccess}}
This is All the text for the .htaccess file: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule (other settings are left either blank or as they were.*) http://%{HTTP_HOST}:8080/guacamole [R,L]
Make sure Special Note: Once settings are in place, users can click on their User Name in the upper right corner and choose "Home" from the owner of drop-down menu to return to the file is apache home screen and the group is users.{{Code|Code = # chown apache .htaccess# chgrp users use pre-configured connections.htaccess}}
In == References ==''1'' https:/etc/httpden.wikipedia.org/conf.dwiki/####-guacamole.conf, change "AllowOverride AuthConfig" to "AllowOverride FileInfo Limit Options Indexes"Remote_Desktop_Protocol
== Port Forwarding ==If you want Guacamole's web interface to be accessible outside of your LAN you will have to forward a random'2'' Richardson, T.; Stafford-Fraser, Q.; Wood, K. R.; Hopper, unused port A. (1111, for example1998) to port 8080 in your router. Then when you access Guacamole from outside your LAN you will need to add "/guacamoleVirtual network computing" to the end of your url(PDF). (serverblahblahIEEE Internet Computing.yourhda2: 33.comdoi:111110.1109/guacamole) If you do not add "/guacamole" to your url, you will see a blank page since you did not specify which application in Tomcat you wanted to access4236.656066.
12,424

edits