Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about how to configuration for WOL docker-compose.yml #12

Closed
zukkie777 opened this issue Aug 24, 2020 · 11 comments
Closed

about how to configuration for WOL docker-compose.yml #12

zukkie777 opened this issue Aug 24, 2020 · 11 comments

Comments

@zukkie777
Copy link

WakeOnLAN function was released in version 1.2.0.
http://guacamole.apache.org/releases/1.2.0/

But I couldn't get WOL to connect to my computer, with settings using docker-compose.yml.

I created some yml files and tested the connection,
Error was output and the WOL connection could not be established.

Please help me.

Thank you.

@zukkie777
Copy link
Author

about log

my-guacd3 | guacd[56]: ERROR: Error connecting to RDP server
my-guacd3 | guacd[56]: INFO: User "@081184c0-81c8-46c8-9526-95ea69a32785" disconnected (0 users remain)
my-guacd3 | guacd[56]: INFO: Last user of connection "$c7540f4e-4f02-4424-aad2-961cb9ae508d" disconnected
my-guacd3 | guacd[6]: INFO: Connection "$c7540f4e-4f02-4424-aad2-961cb9ae508d" removed.
my-guacamole3 | Exception in thread "Thread-14" java.lang.IllegalStateException: Message will not be sent because the WebSocket session has been closed
my-guacamole3 | at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:424)
my-guacamole3 | at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:309)
my-guacamole3 | 23:00:42.537 [http-nio-8080-exec-7] INFO o.a.g.tunnel.TunnelRequestService - User "guacadmin" disconnected from connection "3". Duration: 15070 milliseconds
my-guacamole3 | at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:250)
my-guacamole3 | at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendString(WsRemoteEndpointImplBase.java:191)
my-guacamole3 | at org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendText(WsRemoteEndpointBasic.java:37)
my-guacamole3 | at org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint.sendInstruction(GuacamoleWebSocketTunnelEndpoint.java:152)
my-guacamole3 | at org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint.access$200(GuacamoleWebSocketTunnelEndpoint.java:53)
my-guacamole3 | at org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint$2.run(GuacamoleWebSocketTunnelEndpoint.java:253)

@boschkundendienst
Copy link
Owner

If it works with the regular docker file you can get it working with docker-compose. - But, WOL is not something you should expect from my docker-compose setup. You might have to do some additional setup yourself. WOL is not part of my tiny project.

@zukkie777
Copy link
Author

zukkie777 commented Sep 2, 2020

I self-solved, about the WOLof guacamole.

If you like it, please refer to it.

http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/How-to-docker-composer-for-WOL-td9164.html

@boschkundendienst
Copy link
Owner

added WOL section to README.MD and linked to the mailinglist entry.

@zukkie777
Copy link
Author

Thanks for comment.
I had updated yml file.

@c2v4
Copy link

c2v4 commented Aug 8, 2021

http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/How-to-docker-composer-for-WOL-td9164.html

This site is not reachable, can we have the solution in the README?

@boschkundendienst
Copy link
Owner

I think it is archived here: http://mail-archives.apache.org/mod_mbox/guacamole-user/202008.mbox/%3C1598776633682-0.post@n4.nabble.com%3E

@tonytvbg
Copy link

Hi, today I tested to start all containers in network mode host according above post, but did not make it. Actually guacd container sends WOL packets and only his network should be outside the bridge. I think the resolution is more easy. Only guacd container "move" to host network, others containers (guacamole and postgres works in bridge mode). Just tell guacamole to connect guacd by IP -(GUACD_HOSTNAME: {host`s ipaddress}; GUACD_PORT: 4822) and of corse remove links to guacd.

@Stonerocker
Copy link

Hi Tonytvbg,
please, can you be more specific. How did you edit your docker-compose.yml?

@tonytvbg
Copy link

tonytvbg commented May 9, 2022

Here is my compose file. Of course the password and guacd IP must be set properly:
version: '2.0'

networks

create a network 'net' in mode 'bridged'

networks:
net:

services

services:

guacd - this is the container with host network

guacd:
container_name: guacd
image: guacamole/guacd
network_mode: host
restart: always
volumes:
- /opt/guacamole/guacd/drive:/drive:rw
- /opt/guacamole/guacd/record:/record:rw

postgres

postgres:
container_name: postgres
environment:
PGDATA: /var/lib/postgresql/data/guacamole
POSTGRES_DB: guacamole_db
POSTGRES_PASSWORD: 'xxxxxxxxxx'
POSTGRES_USER: guacamole_user
image: postgres:13.4
networks:
net:
restart: always
volumes:
- /opt/guacamole/postgres/init:/docker-entrypoint-initdb.d:ro
- /opt/guacamole/postgres/data:/var/lib/postgresql/data:rw

guacamole

guacamole:
container_name: guacamole
depends_on:
- guacd
- postgres
environment:
GUACD_HOSTNAME: 172.17.0.1 # this is the guacd assigned ip from host. May be the name guacd should works.
GUACD_PORT: 4822
POSTGRES_DATABASE: guacamole_db
POSTGRES_HOSTNAME: postgres
POSTGRES_PASSWORD: 'xxxxxxxxx'
POSTGRES_USER: guacamole_user
GUACAMOLE_HOME: /home/guacamole/home_guac
image: guacamole/guacamole
volumes:
- /opt/guacamole/guacamole/home:/home/guacamole/home_guac
networks:
net:
ports:

enable next line if not using nginx

- 8080:8080/tcp # Guacamole is on :8080/guacamole, not /.

enable next line when using nginx

- 8080/tcp
restart: always

########### optional ##############

nginx

nginx:
container_name: nginx
restart: always
image: nginx
volumes:
- /opt/guacamole/nginx/ssl/self.cert:/etc/nginx/ssl/self.cert:ro
- /opt/guacamole/nginx/ssl/self-ssl.key:/etc/nginx/ssl/self-ssl.key:ro
- /opt/guacamole/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- /opt/guacamole/nginx/mysite.template:/etc/nginx/conf.d/default.conf:ro
ports:
- 8443:443
links:
- guacamole
networks:
net:

run nginx

command: /bin/bash -c "nginx -g 'daemon off;'"

nginx-debug-mode

command: /bin/bash -c "nginx-debug -g 'daemon off;'"

@Mickey016
Copy link

Hi all,

after a lot of tinkering and the help of several ressources on the web, I managed to get a docker setup with usable Wake On LAN.

My biggest help was the info posted by tonytvbg, so thank you mate !

As it took me quite some time to aget everything working, I thought I too would share my compose file here.
It has been working ok on my Synology NAS with the Sync Reverse Proxy (no nginx used in Docker).
I use Portainer and its "Stack" functionality for deployment.

In this first part, I have adapted some steps taken from the prepare.sh script (maybe some commands are not really necessary).

TODO before deploying the stack !!!!!!!! use SSH and root on the NAS !!!!!!

# mkdir /volume1/docker/guacamole/postgres/init >/dev/null 2>&1
# chmod -R +x /volume1/docker/guacamole/postgres/init
# docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgresql > /volume1/docker/guacamole/postgres/init/initdb.sql
# chmod 777 /volume1/docker/guacamole/postgres/init/initdb.sql
# chmod +x /volume1/docker/guacamole/postgres/init/initdb.sql
# mkdir /volume1/docker/guacamole/postgres/data
# mkdir /volume1/docker/guacamole/guacamole/etc
# chmod -R 777 /volume1/docker/guacamole/guacamole/etc
# mkdir /volume1/docker/guacamole/guacamole/home
# chmod -R 777 /volume1/docker/guacamole/guacamole/etc

And here is the compose file with a bit cleaner look compared to the one tonytvbg posted ;-)

version: '2.0'

networks:
  guacnetwork_compose:
    driver: bridge
      
services:

  guacd:
    container_name: guacd_guacamole
    image: guacamole/guacd
    network_mode: "host"
    environment:
      TZ: Europe/Paris
      POSTGRESQL_HOSTNAME: postgres
    restart: always
    ports:
    - 4822:4822/tcp
    volumes:
    - /volume1/docker/guacamole/guacd/drive:/drive:rw
    - /volume1/docker/guacamole/guacd/record:/record:rw
    
  postgres:
    container_name: postgres_guacamole
    environment:
      TZ: Europe/Paris
      PGDATA: /var/lib/postgresql/data/guacamole
      POSTGRESQL_DB: guacamole_db
      POSTGRESQL_HOSTNAME: postgres
      POSTGRESQL_PASSWORD: 'ChooseYourOwnPasswordHere1234'
      POSTGRESQL_USER: guacamole_user
    image: postgres:15.2-alpine
    networks:
      guacnetwork_compose:
    restart: always
    volumes:
    - /volume1/docker/guacamole/postgres/init:/docker-entrypoint-initdb.d:z
    - /volume1/docker/guacamole/postgres/data:/var/lib/postgresql/data:Z

  guacamole:
    container_name: guacamole_guacamole
    depends_on:
    - guacd
    - postgres
    environment:
      TZ: Europe/Paris
      GUACD_HOSTNAME: 172.17.0.1
      GUACD_PORT: 4822
      POSTGRESQL_DATABASE: guacamole_db
      POSTGRESQL_HOSTNAME: postgres
      POSTGRESQL_PASSWORD: 'ChooseYourOwnPasswordHere1234'
      POSTGRESQL_USER: guacamole_user
    image: guacamole/guacamole
    networks:
      guacnetwork_compose:
    ports:
    - 18080:8080/tcp # Guacamole is on :8080/guacamole, not /.
    restart: always
    volumes:
     - /volume1/docker/guacamole/guacamole/etc:/etc/guacamole:rw
     - /volume1/docker/guacamole/guacamole/home:/home/guacamole:rw

I'm really happy now with my setup, I can access different machines remotely without having to keep them on all the time. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants