Category: Xubuntu

Guacamole: clientless remote desktop – latest version tutorial on Ubuntu/Xubuntu 14.04/16.04

Guacamole website: http://guacamole.incubator.apache.org/

Guacamole user guide: http://guacamole.incubator.apache.org/doc/gug/users-guide.html

 

guacamole-server

Required dependencies:

sudo apt install libcairo2-dev libjpeg-dev libpng12-dev libossp-uuid-dev libavcodec-dev libswscale-dev

Optional dependencies for VNC, RDP, SSH, and Telnet support:

sudo apt install libfreerdp-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev libwebp-dev

Required dependency in order to launch the configure script:

sudo apt install libtool

 

Source code

Stable releases download: http://guacamole.incubator.apache.org/releases/

wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-server-0.9.9.tar.gz
tar -xzf guacamole-server-0.9.9.tar.gz
mv guacamole-server-0.9.9 guacamole-server

or latest Github revision:

git clone https://github.com/apache/incubator-guacamole-server guacamole-server

Enter source folder

cd guacamole-server

Only for Github source: files downloaded directly from git will not contain the configure script, as autogenerated code is not included in the project’s repositories. So we need an extra package to be installed:

sudo apt install autoconf libtool

and generate configure manually:

autoreconf -fi

 

Build and install

./configure --with-init-dir=/etc/init.d

The --with-init-dir=/etc/init.d shown above prepares the build to install a startup script for guacd into the /etc/init.d directory, such that we can later easily configure guacd to start automatically on boot.

make
sudo make install
sudo ldconfig
cd ..

 

guacamole-client

Required dependencies: we need the Tomcat servlet container, website: http://tomcat.apache.org/

sudo apt install tomcat7

To compile we need Maven and the Java SDK (called JDK) because the Java JRE (jre-default) is not enough:

sudo apt-get install maven default-jdk

 

Source code

Download the stable release

wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-client-0.9.9.tar.gz
tar -xzf guacamole-client-0.9.9.tar.gz
mv guacamole-client-0.9.9 guacamole-client

or latest revision from Github:

git clone https://github.com/apache/incubator-guacamole-client.git guacamole-client
cd guacamole-client

 

Build and install

Ready to compile the java package:

mvn package

Move and rename the webapp to simplify the resulting URL

sudo cp guacamole/target/guacamole-0.9.10-incubating.war /var/lib/tomcat7/webapps/guacamole.war
cd ..

 

Configure

Create the configuration folder

sudo mkdir /etc/guacamole

Link our configuration folder to guacamole’s default location

sudo ln -s /etc/guacamole /usr/share/tomcat7/.guacamole


Create the properties file

sudo mousepad /etc/guacamole/guacamole.properties

and edit as follow:

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

# Location to read extra .jar's from
lib-directory: /var/lib/tomcat7/webapps/guacamole/WEB-INF/classes

# Authentication provider class
auth-provider: net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider

# Properties used by BasicFileAuthenticationProvider
basic-user-mapping: /etc/guacamole/user-mapping.xml

Create the client’s list

sudo mousepad /etc/guacamole/user-mapping.xml

edit as u need, the reference is here:
href=”http://guacamole.incubator.apache.org/doc/gug/configuring-guacamole.html

Example: (authorize username and password can be left empty for anonymous login)

<user-mapping> 
    <authorize username="admin" password="admin">
        <!-- RDP - Remotedesktop -->
        <!-- Parameters explained here: http://guac-dev.org/doc/gug/configuring-guacamole.html#rdp -->

        <connection name="Redmond OS7 RDP (simple login)">
                <protocol>rdp</protocol>
                <param name="hostname">192.168.0.10</param>      <!-- FQDN or host IP -->
                <param name="port">2389</param>                   <!-- Port, Standard is 3389 -->
                <param name="disable-audio">true</param>          <!-- disable audio -->
        </connection>

        <connection name="Redmond OS7 RDP (extended login)">
                <protocol>rdp</protocol>
                <param name="hostname">192.168.2.112</param>      <!-- FQDN or host IP -->
                <param name="port">3389</param>                   <!-- Port, Standard is 3389 -->
                <param name="username">cesare</param>       <!-- Login -->
                <param name="password">cesare</param>        <!-- Password -->
        <param name="domain">mydomain.local</param>              <!-- Domain -->
                <param name="disable-audio">true</param>          <!-- disable audio -->
                <param name="server-layout">it-it-qwerty</param>  <!-- IT keyboard layout -->
        </connection>
 
        <connection name="Linux Mint 18 VM">
                <protocol>rdp</protocol>
                <param name="hostname">192.168.0.100</param>      <!-- FQDN or host IP -->
                <param name="port">3389</param>                   <!-- Port, Standard is 3389 -->
                <param name="disable-audio">true</param>          <!-- disable audio -->
        </connection>

        <!-- WebSSH -->
        <!-- Parameters explained here: http://guac-dev.org/doc/gug/configuring-guacamole.html#ssh -->
        <connection name="SSH Server #1">
                <protocol>ssh</protocol>
                <param name="hostname">192.168.0.100</param>      <!-- FQDN or host IP -->
                <param name="port">22</param>                     <!-- Port, standard is 22 -->
                <param name="username">myname</param>             <!-- login -->
                <param name="password">mypassword</param>        <!-- password -->
                <param name="color-scheme">green-black</param>        <!-- set the color scheme -->
                <param name="font-name">Ubuntu Mono</param>        <!-- set the font family -->

        </connection>
    </authorize>
</user-mapping>

 

Services start

14.04 releases

sudo service tomcat7 restart
sudo service guacd start

16.04 releases

sudo systemctl restart tomcat7
sudo systemctl start guacd

 

Connect to Guacamole

Browse to:

http://<server-ip>:8080/guacamole

 

Enable Guacamole to run at startup

14.04 releases

sudo update-rc.d tomcat7 defaults
sudo update-rc.d guacd defaults

16.04 releases

sudo systemctl enable tomcat7
sudo systemctl enable guacd


TODO:
http://stackoverflow.com/questions/14325171/setting-default-application-in-tomcat-7

How to fix “There is no public key available for the following key IDs”

When I run the command

sudo apt-get update

I got this warning:

There is no public key available for the following key IDs: [key_id]

To fix:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [key_id]

The command above downloads the missing key using the hexadecimal numbers given the [key_id] with apt-key. After running apt-key to download the missing [key_id], any packages from that repositories will be considered trusted.

How to install .ttf fonts in Xubuntu

Fonts only for your user

mkdir ~/.fonts
cp <myfont.ttf> ~./fonts/

Or system wide fonts

cp <myfont.ttf> /usr/share/fonts/truetype/

Then reload the fonts cache

sudo fc-cache -f

How to configure the NFS server and mount NFS shares (Xubuntu 14.04)

NFS Server

Just one package to install:

apt-get update
apt-get install nfs-kernel-server

Create the folder which we want to share

mkdir /srv/nfs

Change the ownership of the folder in order to limit the rights of the client:

chown nobody:nogroup /srv/nfs

PS: do not share the /home directory because it will cause a massive permissions problem.

Now we have to inform the NFS server about what we what to share:

nano /etc/exports

and add the sharing point /srv/nfs:

[...]
/srv/nfs          *(rw,no_root_squash,async,no_subtree_check)

or in case we want to limit the share to a single client with IP=192.168.0.100:

[...]
/srv/nfs          192.168.0.100(rw,no_root_squash,async,no_subtree_check)

Next update the NFS table with the new sharing point

exportfs -rav

Finally start the NFS service:

service nfs-kernel-server start

 

NFS Client

Just one package to install:

sudo apt-get update
sudo apt-get install nfs-common

create the NFS mount point:

sudo mkdir -p /mnt/nfs

Next mount the NFS shared folder:

sudo mount -t nfs 192.168.0.80:/srv/nfs /mnt/nfs/

Now we are connected with the NFS share, we will crosscheck it as follows:

mount -t nfs
192.168.2.80:/srv/nfs on /mnt/nfs type nfs (rw,vers=4,addr=192.168.2.80,clientaddr=192.168.2.100)
Permanent NFS mounting

Add the NFS share in /etc/fstab file

 nano /etc/fstab

with:

 [...]
 192.168.0.80:/ /mnt/nfs nfs defaults 0 0

WordPress Themes