You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Takahiro SUZUKI <zu...@gmail.com> on 2020/08/15 08:47:21 UTC

Re: How to docker-compose for WOL

Additional infomation.
guacamole server log was outputed below.
I am waiting for information.

-----------------------------------------
my-guacamole | 08:43:28.037 [http-nio-8080-exec-4] INFO 
o.a.g.tunnel.TunnelRequestService - User "guacadmin" connected to connection
"3".

my-guacamole | Exception in thread "Thread-100"
java.lang.IllegalStateException: Message will not be sent because the
WebSocket session has been closed
my-guacamole | 	at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:424)
my-guacamole | 	at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:309)
my-guacamole | 	at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:250)
my-guacamole | 08:43:36.251 [http-nio-8080-exec-1] INFO 
o.a.g.tunnel.TunnelRequestService - User "guacadmin" disconnected from
connection "3". Duration: 8213 milliseconds
my-guacamole | 	at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendString(WsRemoteEndpointImplBase.java:191)
my-guacamole | 	at
org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendText(WsRemoteEndpointBasic.java:37)
my-guacamole | 	at
org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint.sendInstruction(GuacamoleWebSocketTunnelEndpoint.java:152)
my-guacamole | 	at
org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint.access$200(GuacamoleWebSocketTunnelEndpoint.java:53)
my-guacamole | 	at
org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint$2.run(GuacamoleWebSocketTunnelEndpoint.java:253)



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: [Resolved!]Re: How to docker-compose for WOL

Posted by Nick Couchman <vn...@apache.org>.
On Sun, Aug 30, 2020 at 4:37 AM Takahiro SUZUKI <zu...@gmail.com> wrote:

>
> I was able to solve the problem about guacd's WOL connection problem using
> docker-compose.
>
> Thank you very much.
>
> I am very thankful for your advice.
>
>
Very glad that you got it working, and, I agree, I hope it helps others
looking for similar functionality.

It's also good to hear that the WoL functionality is being put to use :-).

-Nick

[Resolved!]Re: How to docker-compose for WOL

Posted by Takahiro SUZUKI <zu...@gmail.com>.

Dear Nick.


I was able to solve the problem about guacd's WOL connection problem using
docker-compose.

Thank you very much.

I am very thankful for your advice.



>The most likely cause of this is that the place at which the PostgreSQL
>database is found has changed when you switched to Host networking mode.
>You need to make sure the configuration of your Guacamole Client container
>points to the correct place, and that the PostgreSQL server is actually
>accessible there.

The outline of the change is described below.

——————————————————————————————
#Changed the PosgresSQL configuration
postgresql.conf
# - Connection Settings -
listen_addresses = '*'
====>Make it connectable, from anywhere

pg_hba.conf
# IPv4 local connections:
#host    all             all             127.0.0.1/32            trust
host    all             all              0.0.0.0/0              trust
====>Make it connectable, from anywhere

——————————————————————————————


#Change the docker-compose.yml  and related file configuration
docker-compose.yml 
network_mode: "host"
====> write to all of container

  postgres:
    environment:
      POSTGRES_HOSTNAME: postgres
====> write to posgres container


  guacd:
    environment:
      POSTGRES_HOSTNAME: postgres
====> write to guacd container

  guacamole:
    environment:
      GUACD_HOSTNAME: guacd
      POSTGRES_HOSTNAME: postgres
====> write to guacamole container


#guacamole.properties 
guacd-hostname: guacd
====> write to same name with services name


 etc/hosts 
127.0.0.1	localhost postgres guacd
====> write to resolve the services name and GUACD_HOSTNAME and
POSTGRES_HOSTNAME

The reason why I noticed the above contents was that the following keywords
were output
 when I connected with the log output method set to debug mode.
====> define the logback.xml

my-guacamole3 | ### Cause: org.postgresql.util.PSQLException: The connection
attempt failed.
my-guacamole3 | Caused by: java.net.UnknownHostException: postgres
my-guacamole3 | Caused by: java.net.UnknownHostException: guacd: No address
associated with hostname



——————————————————————————————


>> In connection I have some questions. .
>>
> >1) Does guacamole support docker host mode?
> >Since other WOL docker images written above are compatible with host
> mode,
> >if in host mode,
> >I thought I could use  WOL in guacamole.
>>
>>
>I do not know of any reason why the Guacamole containers would not support
>host mode networking, but you'll need to configure things differently to
>interconnect the various containers.

As I wrote before.

This WOL connectivity issue is not a problem with apache.guacamole,
I understood that it relies on setting up the container interconnect when
using posgress and apache.guacamole.


>>
>> 2) Is the magic packet of wol sent by the guagd process?
>>
>>
>Yes, the magic WoL packet is sent by guacd.
I also confirmed by packet capture.


>> 3)In case of dokcer, do I need to define other WOL docker images?
>>
>>
>>
>No, this is handled completely by guacd - there are no additional
>components required.

I have confirmed that guacd is sending magic packets.


>>
>> 4) Are the guacamoke and guacd images on docker-hub official images?
>> The reason for this question is that OFFICEIAL is not checked.
>>
>> ----------------------------------------------------------------------------
>> # docker search guacamole
>> NAME DESCRIPTION STARS OFFICIAL AUTOMATED
>> guacamole/guacamole Apache Guacamole is a clientless remote desk… 177
> >guacamole/guacd The native server-side proxy used by Apache …83
>
>
>Yes, those are the official images.  I do not know what is required to get
>Docker to tick the "official" box, but perhaps we'll have to dig into that
>on the Project side and see.
OK.
understood.


>
>> ----------------------------------------------------------------------------
>>
>> 5) Are the latest images of guacamoke and guacd on docker-hub 1.2.0 and
>> WOL
> compatible?
>
>
>Yes, WoL support was introduced in 1.2.0, and the Docker images built for
>that version include the support.

I've confirmed. It is possible to send magic packets with version 1.2.0.
And I've confirmed, docker images.

>> Sorry for the very rude question.
>> Checking all possibilities because I am looking for a solution.
>
>
>You have no reason to apologize - the mailing list is here to help provide
>solutions and answer questions like these!  The use-case you're trying to
>accomplish - running Guacamole in Docker but requiring network broadcast
>support for Wake-On-LAN - is slightly complicated and a bit of a corner
>case (not really something Docker is designed to easily handle).  You also
>probably aren't the only one who is struggling with this or will ever
>struggle with it, so hopefully this will help other folks who might be
>trying to accomplish the same thing.


I think my effort was never wasteful, though it took over two weeks.

I sincerely hope to help the apache.guacamole users around the world.

Once again, I would like to thank you again.



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: How to docker-compose for WOL

Posted by Nick Couchman <vn...@apache.org>.
On Thu, Aug 27, 2020 at 7:07 PM Takahiro SUZUKI <zu...@gmail.com> wrote:

>
> Hello Nick.
>
>
> Please help me again.
> Sorry for the questions related to docker.
>
> I haven't solved WOL yet.
>
> However, since it was necessary to be able to use WOL on docker and
> guacamole,
> I had to separate it.
>
>
> I have pulled other WOL docker images,
> When I built docker-compose in network mode host mode
> The magic host was sent and the target host started.
> Ie WOL worked.
>
> Based on that,
> Similarly, in the created guacamole docker-compose.yaml file, changed the
> network mode to host mode.
> After changing it, launching docker-compose and accessing the browser,
> The following log was output and an error was output on the browser.
>
>
> ----------------------------------------------------------------------------
> guacamole_compose2 | 21:36:12.198 [http-nio-8080-exec-6] WARN
> oageAuthenticationProviderFacade-The "postgresql" authentication provider
> has encountered an internal error which will halt the authentication
> process.If this is unexpected or you are the developer of If this is
> expected and you wish to ignore such failures in the future, please set
> "skip-if-unavailable: postgresql" within your guacamole.properties. this
> authentication provider, you may wish to enable debug-level logging.
> guacamole_compose2 | 21:36:12.199 [http-nio-8080-exec-6] ERROR
> o.a.g.rest.RESTExceptionMapper-Unexpected internal error:
> guacamole_compose2 | ### Error querying database. Cause:
> org.postgresql.util.PSQLException: The connection attempt failed.
> guacamole_compose2 | ### The error may exist in
> org/apache/guacamole/auth/jdbc/user/UserMapper.xml
> guacamole_compose2 | ### The error may involve
> org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
> guacamole_compose2 | ### The error occurred while executing a query
> guacamole_compose2 | ### Cause: org.postgresql.util.PSQLException: The
> connection attempt failed.
>
> ----------------------------------------------------------------------------
>
>
The most likely cause of this is that the place at which the PostgreSQL
database is found has changed when you switched to Host networking mode.
You need to make sure the configuration of your Guacamole Client container
points to the correct place, and that the PostgreSQL server is actually
accessible there.


> In connection I have some questions. .
>
> 1) Does guacamole support docker host mode?
> Since other WOL docker images written above are compatible with host mode,
> if in host mode,
> I thought I could use  WOL in guacamole.
>
>
I do not know of any reason why the Guacamole containers would not support
host mode networking, but you'll need to configure things differently to
interconnect the various containers.


>
> 2) Is the magic packet of wol sent by the guagd process?
>
>
Yes, the magic WoL packet is sent by guacd.


> 3)In case of dokcer, do I need to define other WOL docker images?
>
>
>
No, this is handled completely by guacd - there are no additional
components required.


>
> 4) Are the guacamoke and guacd images on docker-hub official images?
> The reason for this question is that OFFICEIAL is not checked.
>
> ----------------------------------------------------------------------------
> # docker search guacamole
> NAME DESCRIPTION STARS OFFICIAL AUTOMATED
> guacamole/guacamole Apache Guacamole is a clientless remote desk… 177
> guacamole/guacd The native server-side proxy used by Apache …83
>
>
Yes, those are the official images.  I do not know what is required to get
Docker to tick the "official" box, but perhaps we'll have to dig into that
on the Project side and see.


>
> ----------------------------------------------------------------------------
>
> 5) Are the latest images of guacamoke and guacd on docker-hub 1.2.0 and WOL
> compatible?
>
>
Yes, WoL support was introduced in 1.2.0, and the Docker images built for
that version include the support.


> Sorry for the very rude question.
> Checking all possibilities because I am looking for a solution.
>
>
You have no reason to apologize - the mailing list is here to help provide
solutions and answer questions like these!  The use-case you're trying to
accomplish - running Guacamole in Docker but requiring network broadcast
support for Wake-On-LAN - is slightly complicated and a bit of a corner
case (not really something Docker is designed to easily handle).  You also
probably aren't the only one who is struggling with this or will ever
struggle with it, so hopefully this will help other folks who might be
trying to accomplish the same thing.

-Nick

Re: How to docker-compose for WOL

Posted by Takahiro SUZUKI <zu...@gmail.com>.
Hello Nick.


Please help me again.
Sorry for the questions related to docker.

I haven't solved WOL yet.

However, since it was necessary to be able to use WOL on docker and
guacamole, 
I had to separate it.


I have pulled other WOL docker images,
When I built docker-compose in network mode host mode
The magic host was sent and the target host started.
Ie WOL worked.

Based on that,
Similarly, in the created guacamole docker-compose.yaml file, changed the
network mode to host mode.
After changing it, launching docker-compose and accessing the browser,
The following log was output and an error was output on the browser.

----------------------------------------------------------------------------
guacamole_compose2 | 21:36:12.198 [http-nio-8080-exec-6] WARN
oageAuthenticationProviderFacade-The "postgresql" authentication provider
has encountered an internal error which will halt the authentication
process.If this is unexpected or you are the developer of If this is
expected and you wish to ignore such failures in the future, please set
"skip-if-unavailable: postgresql" within your guacamole.properties. this
authentication provider, you may wish to enable debug-level logging.
guacamole_compose2 | 21:36:12.199 [http-nio-8080-exec-6] ERROR
o.a.g.rest.RESTExceptionMapper-Unexpected internal error:
guacamole_compose2 | ### Error querying database. Cause:
org.postgresql.util.PSQLException: The connection attempt failed.
guacamole_compose2 | ### The error may exist in
org/apache/guacamole/auth/jdbc/user/UserMapper.xml
guacamole_compose2 | ### The error may involve
org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
guacamole_compose2 | ### The error occurred while executing a query
guacamole_compose2 | ### Cause: org.postgresql.util.PSQLException: The
connection attempt failed.
----------------------------------------------------------------------------

In connection I have some questions. .

1) Does guacamole support docker host mode?
Since other WOL docker images written above are compatible with host mode,
if in host mode,
I thought I could use  WOL in guacamole.


2) Is the magic packet of wol sent by the guagd process?

3)In case of dokcer, do I need to define other WOL docker images?



4) Are the guacamoke and guacd images on docker-hub official images?
 The reason for this question is that OFFICEIAL is not checked.
----------------------------------------------------------------------------
# docker search guacamole
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
guacamole/guacamole Apache Guacamole is a clientless remote desk… 177
guacamole/guacd The native server-side proxy used by Apache …83

----------------------------------------------------------------------------

5) Are the latest images of guacamoke and guacd on docker-hub 1.2.0 and WOL
compatible?

Sorry for the very rude question.
Checking all possibilities because I am looking for a solution.

Thank you.




--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: How to docker-compose for WOL

Posted by Nick Couchman <vn...@apache.org>.
On Mon, Aug 17, 2020 at 6:57 AM Takahiro SUZUKI <zu...@gmail.com> wrote:

>
> Hello, vnick.
>
> Thanks for your detail information.
>
> I re-tried below, but still I could  not success wol  with guacamole WebUI.
>
> I unset(disabled) the FireWall of host.
>
> I test the below.
>  container =>   input ping           to host and other  host is OK.
>  container =>   input the wakeonlan command to other host  is OK.
>
> And ,I wrote  to yml file the below.
> —————————————————
>   guacd:
>     container_name: my-guacd
>     image: guacamole/guacd:latest
>     restart: unless-stopped
>     networks:
>       - guacamole-network
>     ports:
>       - "7:7"
>       - "9:9"
>
> —————————————————
>
> I think it's correct, the above is able to connect to a ”physical network”.
> Is this correct? Is it wrong?
>
>
Again, I'm not very familiar with Docker, but I don't think this connects
the guacd container to the physical network, I think it connects it to a
private, container-only network called "guacamole-network" and then maps
TCP ports 7 and 9 from the outside network through to the guacd container.
This is the opposite direction of what you need to get working, and, again,
Wake-on-LAN support is about making sure that broadcast packets get
through, not so much about a specific TCP or UDP port.

-Nick

Re: How to docker-compose for WOL

Posted by Takahiro SUZUKI <zu...@gmail.com>.
Hello, vnick.

Thanks for your detail information.

I re-tried below, but still I could  not success wol  with guacamole WebUI.

I unset(disabled) the FireWall of host.

I test the below.
 container =>   input ping           to host and other  host is OK.
 container =>   input the wakeonlan command to other host  is OK.

And ,I wrote  to yml file the below.
—————————————————
  guacd:
    container_name: my-guacd
    image: guacamole/guacd:latest
    restart: unless-stopped
    networks:
      - guacamole-network
    ports:
      - "7:7"
      - "9:9"

—————————————————

I think it's correct, the above is able to connect to a ”physical network”.
Is this correct? Is it wrong?




--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: How to docker-compose for WOL

Posted by Nick Couchman <vn...@apache.org>.
On Sat, Aug 15, 2020 at 4:47 AM Takahiro SUZUKI <zu...@gmail.com> wrote:

>
> Additional infomation.
> guacamole server log was outputed below.
> I am waiting for information.
>
>
The output from the log you posted is from the Guacamole Client container
(Tomcat/Catalina).  The Wake-on-LAN packet is part of libguac in guacd, and
will be sent by the gaucd instance, so you need to look at the log files
from that container, instead.

Also, several people have reported issues getting Guacamole to send WoL
packets from Docker.  There are several ways to set up Docker networking,
and I believe that the default is to set up a private network and then NAT
all of the traffic going out from the Docker host IP.  Wake-on-LAN will
almost certainly *NOT* work in this configuration - what is very likely to
happen is that the guacd container will send the broadcast packet out on
its local interface, which will broadcast only within the local, private
container network and will never make it out of the Docker host - that is,
the way those NATd networks behave, broadcast traffic does not get
forwarded.

If you want WoL to work from guacd running in Docker you will likely have
to configure a bridged interface where Docker containers have access to the
physical network via a Linux bridge, or some other form of direct access to
a network interface where the container running guacd is *directly*
assigned an IP address on the physical network.  Just mapping a single IP
to a Docker container will probably suffer from the same pitfalls as NAT
mentioned above, where broadcast traffic will not be forwarded.  Even a
bridged configuration will need to be properly configured, taking into
account firewalls and settings on the Linux host that might filter or block
broadcast traffic.

I'll offer as a disclaimer that my overall familiarity with Docker is
mediocre, so some of my terminology here may be a bit off.  Bottom line,
you have to use a networking mode where the broadcast packets from the
guacd container can actually make it onto the physical network.

-Nick