2

I installed Apache Guacamole using Docker on a CentOS 8.1 with Docker 19.03.

I followed the steps described here:

I started the containers like this:

# mysql container
docker run --name guacamole-mysql -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_ONETIME_PASSWORD=yes -d mysql/mysql-server

# guacd container
docker run --name guacamole-guacd -e GUACD_LOG_LEVEL=debug -d guacamole/guacd

# guacamole container
docker run --name guacamole-guacamole --link guacamole-guacd:guacd --link guacamole-mysql:mysql -e MYSQL_DATABASE=guacamole -e MYSQL_USER=guacamole -e MYSQL_PASSWORD=password -d -p 8080:8080 guacamole/guacamole

All went fine and I was able to access the Guacamole web interface on port 8080. I configured one VNC connection to another machine on port 5900. Unfortunately when I try to use that connection I get the following error in the web interface:

"An internal error has occurred within the Guacamole server, and the connection has been terminated..."

I had a look on the logs too and in the guacamole log I found this:

docker logs --tail all -f guacamole-guacamole
...
15:54:06.262 [http-nio-8080-exec-2] ERROR o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Creation of WebSocket tunnel to guacd failed: End of stream while waiting for "args".
15:54:06.685 [http-nio-8080-exec-8] ERROR o.a.g.s.GuacamoleHTTPTunnelServlet - HTTP tunnel request failed: End of stream while waiting for "args".

I'm sure that the target machine (which is running the VNC server) is fine. I'm able to connect to it from both a VNC client and another older Guacamole which I installed previously (not using Docker).

My containers look ok too:

docker container ps

CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                 PORTS                    NAMES
ad62aaca5627        guacamole/guacamole   "/opt/guacamole/bin/…"   About an hour ago   Up About an hour       0.0.0.0:8080->8080/tcp   guacamole-guacamole
a46bd76234ea        guacamole/guacd       "/bin/sh -c '/usr/lo…"   About an hour ago   Up About an hour       4822/tcp                 guacamole-guacd
ed3a590b19d3        mysql/mysql-server    "/entrypoint.sh mysq…"   2 hours ago         Up 2 hours (healthy)   3306/tcp, 33060/tcp      guacamole-mysql

I connected to the guacamole-guacamole container and pinged the other two containers: guacamole-mysql and guacamole-guacd. Both look fine and reachable.

docker exec -it guacamole-guacamole bash

root@ad62aaca5627:/opt/guacamole# ping guacd
PING guacd (172.17.0.2) 56(84) bytes of data.
64 bytes from guacd (172.17.0.2): icmp_seq=1 ttl=64 time=0.191 ms
64 bytes from guacd (172.17.0.2): icmp_seq=2 ttl=64 time=0.091 ms

root@ad62aaca5627:/opt/guacamole# ping mysql
PING mysql (172.17.0.3) 56(84) bytes of data.
64 bytes from mysql (172.17.0.3): icmp_seq=1 ttl=64 time=0.143 ms
64 bytes from mysql (172.17.0.3): icmp_seq=2 ttl=64 time=0.102 ms

Looks like there is a communication issue between the guacamole itself and guacd. And this is where I'm completely stuck.

EDIT

I tried on CentOS 7 and I got the same issues.

I also tried this solution https://github.com/boschkundendienst/guacamole-docker-compose as suggested by @BatchenRegev but I got the same issue again.

Ciprian Stoica
  • 2,309
  • 5
  • 22
  • 36
  • 2
    I can just recommend to you to use this for docker and guacamole : https://github.com/boschkundendienst/guacamole-docker-compose , i have tried many versions of docker guacamole and this is the only one that works fine. i used psql but i think you can use mysql. – Batchen Regev Feb 20 '20 at 22:52
  • 1
    @BatchenRegev, thanks for your suggestion. I tried it and I got exactly the same error. It might have worked in your case for some earlier versions of guacamole container images. But looks like the current ones don't work. – Ciprian Stoica Feb 27 '20 at 14:38
  • 1
    well then it means somthing about your environment is wrong, im using ubuntu 18.4 and docker-compose 1.25, but maybe in your centos something is blocking it, i would suggest maybe cancel selinux and look if you have firewall up to cancel it and then check again, its the latest guacamole in the link i shared with you – Batchen Regev Feb 29 '20 at 17:32
  • 1
    @BatchenRegev, I installed an Ubuntu 18.4 on a totally different infrastructure and tried on that but I got exactly the same issues. I must be on a weird side of the universe I guess. :-) I have no other explanation. I gave up testing the latest guacamole for the moment and I'll stick with version 0.9.9 (non-containerised) for a while. Thank you very much for your suggestions. – Ciprian Stoica Mar 19 '20 at 08:03

2 Answers2

1

I've been experiencing the same issues under centos.

My only difference is that I'm hosting the database on a separate machine as this is all cloud-hosted and I want to be able to destroy/rebuild the guacamole server at will.

I ended creating a docker-compose.yml file as that seemed to work better.

Other gotcha's I came across:

  • make sure the guacd_hostname is the actual machine hostname and not 127.0.0.1
  • setting Selinux to allow httpd.

    sudo setsebool -P httpd_can_network_connect

My docker-compose.yml is shown below replace all {variables} with your own and update the file if you are using a sql image as well.

version: "2"
services:
  guacd:
    image: "guacamole/guacd"
    container_name: guacd
    hostname: guacd
    restart: always
    volumes:
      - "/data/shared/guacamole/guacd/data:/data"
      - "/data/shared/guacamole/guacd/conf:/conf:ro"
    expose:
      - "4822"
    ports:
      - "4822:4822"
    network_mode: bridge

  guacamole:
    image: "guacamole/guacamole"
    container_name: guacamole
    hostname: guacamole
    restart: always
    volumes:
      - "/data/shared/guacamole/guacamole/guac-home:/data"
      - "/data/shared/guacamole/guacamole/conf:/conf:ro"
    expose:
      - "8080"
    ports:
      - "8088:8080"
    network_mode: bridge
    environment:
      - "GUACD_HOSTNAME={my_server_hostname}"
      - "GUACD_PORT=4822"
      - "MYSQL_PORT=3306"
      - "MYSQL_DATABASE=guacamole"
      - "GUACAMOLE_HOME=/data"
      - "MYSQL_USER=${my_db_user}"
      - "MYSQL_PASSWORD=${my_db_password}"
      - "MYSQL_HOSTNAME=${my_db_hostname}"
Marcus Adams
  • 1,237
  • 1
  • 12
  • 26
  • 1
    I tried your suggestions but unfortunately nothing has changed. I even switched to a Ubuntu 18.4 but I got exactly the same issues. So I gave up for the moment. Anyway, thank you very much for your suggestions. – Ciprian Stoica Mar 19 '20 at 08:07
0

i have the same problem on FreeBSD 12.2 - SOLUTION Change "localhost" hostname in

/usr/local/etc/guacamole-client/guacamole.properties

to "example"

guacd-hostname: 192.168.10.10

next: /usr/local/etc/guacamole-server/guacd.conf

[server]
bind_host = 192.168.10.10

Check /etc/guacamole/guacamole.properties i have link:

guacd-hostname: 192.168.10.10

Restart:

/usr/local/etc/rc.d/guacd restart
/usr/local/etc/rc.d/tomcat9 restart

with name "localhost" i have: 11:01:48.010 [http-nio-8085-exec-3] DEBUG o.a.g.s.GuacamoleHTTPTunnelServlet - Internal error in HTTP tunnel. I hope it will be useful to someone else - it works for me`