Web-Based Guacamole tool

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

Create database for Guacamole: (DB name is guacamole_db)

$ mysql -u root -p

mysql> create database guacamole_db;
mysql> grant all privileges on guacamole_db.* to guacamole_user@localhost identified by 'secure password';
mysql> flush  privileges;

Initializing the MySQL database

$ docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > initdb.sql

$ mysql -u guacamole_user -p guacamole_db < initdb.sql

Create my-guacd docker container

$ docker run --name my-guacd -d guacamole/guacd

Create my-guacamole docker container

docker run --name my-guacamole \
  --link my-guacd:guacd \
  -e MYSQL_HOSTNAME=${DB_HOST} \
  -e MYSQL_PORT=${DB_PORT} \
  -e MYSQL_DATABASE=${DB_NAME} \
  -e MYSQL_USER=${DB_USER} \
  -e MYSQL_PASSWORD=${DB_PASS} \
  -d -p 8080:8080 guacamole/guacamole

Test:

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

Logs:

$ docker logs my-guacamole

Behind apache proxy:

<Location /guacamole/>
    Order allow,deny
    Allow from all
    ProxyPass http://HOSTNAME:8080/guacamole/ flushpackets=on
    ProxyPassReverse http://HOSTNAME:8080/guacamole/
</Location>

<Location /guacamole/websocket-tunnel>
    Order allow,deny
    Allow from all
    ProxyPass ws://HOSTNAME:8080/guacamole/websocket-tunnel
    ProxyPassReverse ws://HOSTNAME:8080/guacamole/websocket-tunnel
</Location>

LXD images and multiple hosts

Remote operations require the following two commands having been run on the remote server:

lxc config set core.https_address "[::]:8443"
lxc config set core.trust_password some-password

Add a remote server:

lxc remote add <server alias> <ip address or DNS>

And after that, use all the same command as above but prefixing the container and images name with the remote host like:

lxc exec host-a:first -- apt-get update

Manually import images example:

lxc image copy images:gentoo/current/amd64 local: --alias gentoo --auto-update
lxc image import <tarball> --alias random-image
lxc image import https://dl.stgraber.org/lxd --alias busybox-amd64

List images:

lxc image list
lxc image list <remote server alias>:

Editing image:

lxc image edit <alias or fingerprint>

Deleting image:

lxc image delete <alias or fingerprint>

Create you own image from a container:

lxc publish my-container/some-snapshot --alias some-image

 

 

Reference:
Installing LXD and the command line tool
LXD 2.0: Image management [5/12]