Tag Archives: Remote Desktop

Installing Guacamole 0.9.13 from source on Debian Stretch and Tomcat 8

Install build tools:

# apt install build-essential maven checkinstall

Install JDK, database and application server:

# apt install openjdk-8-jdk mariadb-server \
mariadb-client mariadb-common tomcat8

Secure your mysql/mariadb installation:

# mysql_secure_installation

Take note of the mysql root password you just created.

Install Guacamole build dependencies:

# apt install libcairo2-dev libjpeg62-turbo-dev \
libpng-dev libossp-uuid-dev libavcodec-dev \
libavutil-dev libswscale-dev libfreerdp-dev \
libpango1.0-dev libssh2-1-dev libtelnet-dev \
libvncserver-dev libpulse-dev libssl-dev \
libvorbis-dev libwebp-dev ghostscript freerdp

Untar the sources:

$ tar -xvzf guacamole-client-0.9.13-incubating.tar.gz
$ tar -xvzf guacamole-server-0.9.13-incubating.tar.gz

Untar the database related parts:

$ tar -xvzf guacamole-auth-jdbc-0.9.13-incubating.tar.gz
$ tar -xvzf mysql-connector-java-5.1.45.tar.gz

Build Guacamole Server

$ cd guacamole-server-0.9.13-incubating
$ ./configure --with-init-dir=/etc/init.d
$ make -j2
$ sudo make install

– or –

$ sudo checkinstall --pkgname=guacamole-guacd -D make install

If using checkinstall should get an output similar to this:

####################################################

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values:

0 – Maintainer: [ root@vm ]
1 – Summary: [ Guacamole Guacd ]
2 – Name: [ guacamole-guacd ]
3 – Version: [ incubating ]
4 – Release: [ 1 ]
5 – License: [ GPL ]
6 – Group: [ checkinstall ]
7 – Architecture: [ amd64 ]
8 – Source location: [ guacamole-server-0.9.13-incubating ]
9 – Alternate source location: [ ]
10 – Requires: [ ]
11 – Provides: [ guacamole-guacd ]
12 – Conflicts: [ ]
13 – Replaces: [ ]

Enter a number to change any of them or press ENTER to continue:

####################################################

Enter the number [3] to change the Version from “incubating” to 0.9.13

You should end up with something like this:

####################################################

This package will be built according to these values:

0 – Maintainer: [ root@vm ]
1 – Summary: [ Guacamole Guacd ]
2 – Name: [ guacamole-guacd ]
3 – Version: [ 0.9.13 ]
4 – Release: [ 1 ]
5 – License: [ GPL ]
6 – Group: [ checkinstall ]
7 – Architecture: [ amd64 ]
8 – Source location: [ guacamole-server-0.9.13-incubating ]
9 – Alternate source location: [ ]
10 – Requires: [ ]
11 – Provides: [ guacamole-guacd ]
12 – Conflicts: [ ]
13 – Replaces: [ ]

Enter a number to change any of them or press ENTER to continue:

####################################################

Press [Enter] to continue and wait for checkinstall to install and build a package

If you ever need to remove the guacamole and you used checkinstall you can do it with:

# dpkg -r guacamole-guacd

Link all the freerdp libraries to the system freerdp library location:

$ sudo ln -s /usr/local/lib/freerdp/* /usr/lib/x86_64-linux-gnu/freerdp/.

Run ldconfig:

# ldconfig -v

Build Guacamole Client:

$ cd ..
$ cd guacamole-client-0.9.13-incubating
$ mvn package

Create the directories to hold extensions and libraries:

# mkdir /etc/guacamole
# mkdir /etc/guacamole/lib
# mkdir /etc/guacamole/extensions
# mkdir /var/lib/guacamole

Deploying the Guacamole:

$ sudo cp guacamole/target/guacamole-0.9.13-incubating.war /var/lib/guacamole/
$ sudo ln -s /var/lib/guacamole/guacamole-0.9.13-incubating.war /var/lib/tomcat8/webapps/guacamole.war

Creating the properties file:

In /etc/guacamole create a file called guacamole.properties with the following content:

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

guacamole.home: /etc/guacamole

#MySQL Properties
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacamole_db
mysql-username: [Guacamole_DB_USERNAME]
mysql-password: [Guacamole_DB PASSWORD]
####################################################

Make sure you take note of the [Guacamole_DB_USERNAME] and [Guacamole_DB PASSWORD] you decide to put in this file. They will be used later on to set up the database.

Link /etc/guacamole to tomcat home directory:

$ sudo ln -s /etc/guacamole /var/lib/tomcat8/.guacamole

Deploy database authentication:

$ cd ..
$ cd guacamole-auth-jdbc-0.9.13-incubating
$ sudo cp mysql/guacamole-auth-jdbc-mysql-0.9.13-incubating.jar /etc/guacamole/extensions/
$ cd ..
$ cd mysql-connector-java-5.1.45
$ sudo cp mysql-connector-java-5.1.45-bin.jar /etc/guacamole/lib/

Create the database:

# mysql -u root -p[MYSQL_ROOT_PASSWORD]
create database guacamole_db;
create user '[Guacamole_DB_USERNAME]'@'localhost' identified by '[Guacamole_DB PASSWORD]';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO '[Guacamole_DB_USERNAME]'@'localhost';
flush privileges;
quit

Populate the database:

# cat guacamole-auth-jdbc-0.9.13-incubating/mysql/schema/*.sql | mysql -u root -p[MYSQL_ROOT_PASSWORD] guacamole_db

Ensure that guacd is enabled:

# systemctl enable guacd

and finally reboot…

If you ever need to backup the database:

# mysqldump -u root -p --add-drop-table guacamole_db > guacamole_db.sql

To restore the backup:

# mysql -u root -p guacamole_db < guacamole_db.sql

To further lockdown the installation

Fix permisions of guacamole.properties so only tomcat can read it by issuing the following:

# cd /etc/guacamole
# chown root:tomcat8
# chmod 640 guacamole.properties

Installing xrdp 9.4 and xorgxrdp 2.4 on Debian Stretch

This is similar to the other two previous xrdp and xorgxrdp how-tos, just needed to adjust for newer versions.

This how-to is based on the install instructions from XRDP’s github pages for installing on Debian 8.

Install xrdp’s dependencies:

$ sudo apt-get install git autoconf libtool pkg-config gcc g++ make libssl-dev libpam0g-dev libjpeg-dev libx11-dev libxfixes-dev libxrandr-dev flex bison libxml2-dev intltool xsltproc xutils-dev python-libxml2 g++ xutils libfuse-dev libmp3lame-dev nasm libpixman-1-dev xserver-xorg-dev

Get the xrdp and xorgxrdp sources:

$ mkdir -p GIT-sources/neutrinolabs
$ cd GIT-sources/neutrinolabs
$ wget https://github.com/neutrinolabs/xrdp/releases/download/v0.9.4/xrdp-0.9.4.tar.gz
$ wget https://github.com/neutrinolabs/xorgxrdp/releases/download/v0.2.4/xorgxrdp-0.2.4.tar.gz

Building and installing xrdp:

$ cd GIT-sources/neutrinolabs
$ tar xvfz xrdp-0.9.4.tar.gz
$ cd xrdp-0.9.4
$ ./bootstrap
$ ./configure --enable-fuse --enable-mp3lame --enable-pixman --enable-sound
$ make -j2
$ sudo make install
$ sudo ln -s /usr/local/sbin/xrdp{,-sesman} /usr/sbin

Building and installing xorgxrdp:

$ cd GIT-sources/neutrinolabs
$ tar xvfz xorgxrdp-0.2.4.tar.gz
$ cd xorgxrdp-0.2.4
$ ./bootstrap
$ ./configure
$ make -j2
$ sudo make install

Generate keys:

$ sudo xrdp-keygen xrdp auto 2048

Building the pulseaudio modules:

$ cd ~
$ mkdir -p Release-sources/pulseaudio
$ cd Release-sources/pulseaudio
$ sudo apt-get install dpkg-dev
$ sudo apt-get source pulseaudio
$ sudo apt-get build-dep pulseaudio

Change the permisions on the pulseaudio directory to your user:

$ sudo chown -R [USER]:[GROUP] pulseaudio-10.0
$ cd pulseaudio-10.0
$ ./configure

In change directory to “~/GIT-sources/neutrinolabs/xrdp-0.9.3/sesman/chansrv/pulse”

$ cd ~
$ cd GIT-sources/neutrinolabs/xrdp-0.9.4/sesman/chansrv/pulse

Edit the Makefile with your favorite editor and point it to the sources for pulseaudio by changing:

PULSE_DIR = /tmp/pulseaudio-10.0

to:

PULSE_DIR = ../../../../../../Release-sources/pulseaudio/pulseaudio-10.0

then:

$ make -j2

If the build is successful , copy the 2 modules to /usr/lib/pulse-10.0/modules.

$ sudo cp module-xrdp*.so /usr/lib/pulse-10.0/modules

Check the /usr/lib/pulse-10.0/modules directory:

$ ls -al /usr/lib/pulse-10.0/modules

If necessary, fix the ownership and permissions on the two modules:

$ cd /usr/lib/pulse-10.0/modules
$ sudo chown root:root module-xrdp-s*.so
$ sudo chmod 644 module-xrdp-s*.so

The modules are named module-xrdp-sink.so and module-xrdp-source.so

Enable the services:

$ sudo systemctl enable xrdp.service
$ sudo systemctl enable xrdp-sesman.service

Fixes for possible issues:

To run it as terminal server (also useful for Guacamole) add allowed_users=anybody to /etc/X11/Xwrapper.config to allow anybody to start X

To fix the thinclient_drives share error when connected via RDP to the client:

$ sudo umount thinclient_drives

logout and re-login via rdp

 

Installing xrdp 9.3.1 and xorgxrdp 2.4 on Debian Stretch

This is similar to the previous xrdp and xorgxrdp how-to, it is just adjusting to the newer versions of all the pieces of software.

This how-to is based on the install instructions from XRDP’s github pages for installing on Debian 8.

Install xrdp’s dependencies:

$ sudo apt-get install git autoconf libtool pkg-config gcc g++ make libssl-dev libpam0g-dev libjpeg-dev libx11-dev libxfixes-dev libxrandr-dev flex bison libxml2-dev intltool xsltproc xutils-dev python-libxml2 g++ xutils libfuse-dev libmp3lame-dev nasm libpixman-1-dev xserver-xorg-dev

Get the xrdp and xorgxrdp sources:

$ mkdir -p GIT-sources/neutrinolabs
$ cd GIT-sources/neutrinolabs
$ wget https://github.com/neutrinolabs/xrdp/releases/download/v0.9.3.1/xrdp-0.9.3.1.tar.gz
$ wget https://github.com/neutrinolabs/xorgxrdp/releases/download/v0.2.4/xorgxrdp-0.2.4.tar.gz

Building and installing xrdp:

$ cd GIT-sources/neutrinolabs
$ tar xvfz xrdp-0.9.3.1.tar.gz
$ cd xrdp-0.9.3.1
$ ./bootstrap
$ ./configure --enable-fuse --enable-mp3lame --enable-pixman --enable-sound
$ make -j2
$ sudo make install
$ sudo ln -s /usr/local/sbin/xrdp{,-sesman} /usr/sbin

Building and installing xorgxrdp:

$ cd GIT-sources/neutrinolabs
$ tar xvfz xorgxrdp-0.2.4.tar.gz
$ cd xorgxrdp-0.2.4
$ ./bootstrap
$ ./configure
$ make -j2
$ sudo make install

Generate keys:

$ sudo xrdp-keygen xrdp auto 2048

Building the pulseaudio modules:

$ cd ~
$ mkdir -p Release-sources/pulseaudio
$ cd Release-sources/pulseaudio
$ sudo apt-get install dpkg-dev
$ sudo apt-get source pulseaudio
$ sudo apt-get build-dep pulseaudio

Change the permisions on the pulseaudio directory to your user:

$ sudo chown -R [USER]:[GROUP] pulseaudio-10.0
$ cd pulseaudio-10.0
$ ./configure

In change directory to “~/GIT-sources/neutrinolabs/xrdp-0.9.3/sesman/chansrv/pulse”

$ cd ~
$ cd GIT-sources/neutrinolabs/xrdp-0.9.3.1/sesman/chansrv/pulse

Edit the Makefile with your favorite editor and point it to the sources for pulseaudio by changing:

PULSE_DIR = /tmp/pulseaudio-10.0

to:

PULSE_DIR = ../../../../../../Release-sources/pulseaudio/pulseaudio-10.0

then:

$ make -j2

If the build is successful , copy the 2 modules to /usr/lib/pulse-10.0/modules.

$ sudo cp module-xrdp*.so /usr/lib/pulse-10.0/modules

Check the /usr/lib/pulse-10.0/modules directory:

$ ls -al /usr/lib/pulse-10.0/modules

If necessary, fix the ownership and permissions on the two modules:

$ cd /usr/lib/pulse-10.0/modules
$ sudo chown root:root module-xrdp-s*.so
$ sudo chmod 644 module-xrdp-s*.so

The modules are named module-xrdp-sink.so and module-xrdp-source.so

Enable the services:

$ sudo systemctl enable xrdp.service
$ sudo systemctl enable xrdp-sesman.service

Fixes for possible issues:

To run it as terminal server (also useful for Guacamole) add allowed_users=anybody to /etc/X11/Xwrapper.config to allow anybody to start X

To fix the thinclient_drives share error when connected via RDP to the client:

$ sudo umount thinclient_drives

logout and re-login via rdp

 

Installing xrdp 9.3 and xorgxrdp 2.3 on Debian Jessie (or Stretch)

This how-to is based on the install instructions from XRDP’s github pages for installing on Debian 8.

Install xrdp’s dependencies:

$ sudo apt-get install git autoconf libtool pkg-config gcc g++ make libssl-dev libpam0g-dev libjpeg-dev libx11-dev libxfixes-dev libxrandr-dev flex bison libxml2-dev intltool xsltproc xutils-dev python-libxml2 g++ xutils libfuse-dev libmp3lame-dev nasm libpixman-1-dev xserver-xorg-dev

Get the xrdp and xorgxrdp sources:

$ mkdir -p GIT-sources/neutrinolabs
$ cd GIT-sources/neutrinolabs
$ wget https://github.com/neutrinolabs/xrdp/releases/download/v0.9.3/xrdp-0.9.3.tar.gz
$ wget https://github.com/neutrinolabs/xorgxrdp/releases/download/v0.2.3/xorgxrdp-0.2.3.tar.gz

Building and installing xrdp:

$ cd GIT-sources/neutrinolabs
$ tar xvfz xrdp-0.9.3.tar.gz
$ cd xrdp-0.9.3
$ ./bootstrap
$ ./configure --enable-fuse --enable-mp3lame --enable-pixman --enable-sound
$ make -j2
$ sudo make install
$ sudo ln -s /usr/local/sbin/xrdp{,-sesman} /usr/sbin

Building and installing xorgxrdp:

$ cd GIT-sources/neutrinolabs
$ tar xvfz xorgxrdp-0.2.3.tar.gz
$ cd xorgxrdp-0.2.3
$ ./bootstrap
$ ./configure
$ make -j2
$ sudo make install

Generate keys:

$ sudo xrdp-keygen xrdp auto 2048

Building the pulseaudio modules:

$ cd ~
$ mkdir -p Release-sources/pulseaudio
$ cd Release-sources/pulseaudio
$ sudo apt-get install dpkg-dev
$ sudo apt-get source pulseaudio
$ sudo apt-get build-dep pulseaudio

Change the permisions on the pulseaudio directory to your user:

$ sudo chown -R [USER]:[GROUP] pulseaudio-10.0
$ cd pulseaudio-10.0
$ ./configure

In change directory to “~/GIT-sources/neutrinolabs/xrdp-0.9.3/sesman/chansrv/pulse”

$ cd ~/GIT-sources/neutrinolabs/xrdp-0.9.3/sesman/chansrv/pulse

Edit the Makefile with your favorite editor and point it to the sources for pulseaudio by changing:

PULSE_DIR = /tmp/pulseaudio-10.0

to:

PULSE_DIR = ../../../../../../Release-sources/pulseaudio/pulseaudio-10.0

then:

$ make -j2

If the build is successful , copy the 2 modules to /usr/lib/pulse-10.0/modules.

$ sudo cp module-xrdp*.so /usr/lib/pulse-10.0/modules

Check the /usr/lib/pulse-10.0/modules directory:

$ ls -al /usr/lib/pulse-10.0/modules

If necessary, fix the ownership and permissions on the two modules:

$ cd /usr/lib/pulse-10.0/modules
$ sudo chown root:root module-xrdp-s*.so
$ sudo chmod 644 module-xrdp-s*.so

The modules are named module-xrdp-sink.so and module-xrdp-source.so

Enable the services:

$ sudo systemctl enable xrdp.service
$ sudo systemctl enable xrdp-sesman.service

Fixes for possible issues:

To run it as terminal server (also useful for Guacamole) add allowed_users=anybody to /etc/X11/Xwrapper.config to allow anybody to start X

To fix the thinclient_drives share error when connected via RDP to the client:

$ sudo umount thinclient_drives

logout and re-login via rdp