@André, I think you should not grant access only to localhost to the guacamole user because the connection between containers comes from a random IP created in the default docker network. So I think you should put ‘%’ (any host) after @ when creating and granting privileges.
Then I think you should grant other privileges to the guacamole_user if you want it to be able to create tables in the guacamole database. I don’t see where you create the “guacamole_db” database, I don’t see any “CREATE DATABASE “ statement. The “initdb.sql” has no CREATE DATABASE statement into it, only CREATE TABLE statements (and some inserts to initialize the DB). After that you should import the initdb.sql with the cat initdb.sql…. etc etc. Regards. Lorenzo Da: André R. Basel <[email protected]> Inviato: giovedì 27 aprile 2023 10:01 A: [email protected] Oggetto: Re: R: Quacamole docker install Thanks Lorenzo I think I might be close now. I created Step 3B: Step 3b: CREATE USER 'guacamole_user'@'localhost' IDENTIFIED BY 'dbuserpwd'; GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'localhost'; FLUSH PRIVILEGES sudo cat initdb.sql | sudo docker exec -i quacamole-mysql /usr/bin/mysql -u guacamole_user -p mypassword guacamole_db I ran the above but it did not work, instead a usage details showed eg sysadmin@services:~$ sudo cat initdb.sql | sudo docker exec -i guacamole-mysql /usr/bin/mysql -u guacamole_user -p rjgtpormdsl837dejkl_kl@ guacamole_db /usr/bin/mysql Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL) Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Usage: /usr/bin/mysql [OPTIONS] [database] -?, --help Display this help and exit. -I, --help Synonym for -? --auto-rehash Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash. (Defaults to on; use --skip-auto-rehash to disable.) -A, --no-auto-rehash No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. --auto-vertical-output Automatically switch to vertical output mode if the result is wider than the terminal width. -B, --batch Don't use history file. Disable interactive behavior. (Enables --silent.) --bind-address=name IP address to bind to. --binary-as-hex Print binary data as hex. Enabled by default for interactive terminals. And there was not tables in the database. Is that line meant to do the same as Step 4: sudo docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > initdb.sql or or something else, or should I be running this before 3B? Kind regards André Basel 027 640 2527 Sent with Proton Mail<https://proton.me/> secure email. ------- Original Message ------- On Thursday, April 27th, 2023 at 19:23, MAURIZI Lorenzo <[email protected]<mailto:[email protected]>> wrote: Hello André, in step 4 you are creating on current directory a script to initialize the database, but you don’t mention if you run that script into your mysql instance, to create database structure. If not, you are trying to run Guacamole without a database set up. Moreover you are missing MYSQL_DATABASE variable in step 5 (see https://guacamole.apache.org/doc/gug/guacamole-docker.html#required-environment-variables) So i think you should: create a new database into the mysql container. For this I would use the mysql command from inside the container, to make it simple, so you should (please note I used your example values, so change them with the real values): docker exec –it quacamole-mysql /bin/bash then mysql –u root –pmypassword! Then in mysql prompt you should create the database Mysql>CREATE DATABASE guacamole_db; Mysql>GRANT ALL PRIVILEGES ON guacamole_db.* TO 'guacamole_user'@'%' IDENTIFIED BY ‘mypassword’; After that you can issue “exit” twice to go back to the container bash prompt and then to the server bash prompt outside the mysql container. Then you should import the “initdb.sql” script to create database structure: cat initdb.sql | docker exec -i quacamole-mysql /usr/bin/mysql -u guacamole_user -pmypassword guacamole_db At this point you should have a complete DB for guacamole. Then you should start youd guacamole container (step 5) adding this environment variable to the command line: -e MYSQL_DATABASE=guacamole_db I think you should not get the error now. I hope that I didn’t write anything wrong! Best regards. Lorenzo Da: André R. Basel <[email protected]<mailto:[email protected]>> Inviato: giovedì 27 aprile 2023 07:26 A: [email protected]<mailto:[email protected]> Oggetto: Quacamole docker install Hi I have been working through the documentation to install Quacamole using docker. The IP of my docker server is 192.168.1.11 Base on my understanding of what I read, I did the following: Step 1: sudo docker run --name my-guacd -d guacamole/guacd Step 2: sudo docker run --name my-guacamole --link my-guacd:guacd -d -p 8080:8080 --restart unless-stopped guacamole/guacamole Step 3: sudo docker run --name quacamole-mysql -e MYSQL_ROOT_PASSWORD=mypassword! -d --restart unless-stopped mysql:latest Step 4: sudo docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > initdb.sql Step 5: sudo docker run --name my-guacamole \ --link my-guacd:guacd \ --link guacamole-mysql:mysql \ -e MYSQL_HOSTNAME=192.168.1.11 \ -e MYSQL_USER=guacamole_user \ -e MYSQL_PASSWORD=mypassword \ --restart unless-stopped \ -d -p 8080:8080 guacamole/guacamole However when looking at the logs I get FATAL: No authentication configured ------------------------------------------------------------------------------- The Guacamole Docker container needs at least one authentication mechanism in order to function, such as a MySQL database, PostgreSQL database, SQLServer database, LDAP directory or RADIUS server. Please specify at least the MYSQL_DATABASE or POSTGRES_DATABASE or SQLSERVER_DATABASE environment variables, or check Guacamole's Docker documentation regarding configuring LDAP and/or custom extensions. My Docker setup looks as follows: [image.png] I tried following the instructions set the database up but I think I may have got those confused. Is there a simplified set of steps to help a NOOB get it up and running, after which I can start playing with the different settings? Kind regards Andre Sent with Proton Mail<https://proton.me/> secure email.
