Score:1

Guacamole only listening on IPv6 localhost

ru flag

I have recently installed Apache Guacamole on Ubuntu 20.04 and also tested with the same result on 21.10. I have it all working but have had to do some workarounds because of this issue.

Here is the guide I created after I had completed my install and figured out all the issues.

My question is around whether anyone knows of a way to make guacd listen on both IPv4 and v6? My work around was orginally to disable IPv6 on the server but that needs to be run on each startup. I then discovered I could change the listening address to 127.0.0.1 and it would listen on IPv4 instead of v6. I know this is probably the fix but I don't understand why I can't make guacd listen on both.

John Mahowald avatar
cn flag
Per that link, "I had to set guacd-hostname to 127.0.0.1 because otherwise it would listen on IPv6 only and failed to work." What exactly is the problem? "failed to work" is not a helpful problem description. Why do you need dual stack? Just ::1 is fine for localhost. Also, please don't rely on external links for your question details, copy relevant details into your question.
ru flag
If it listens on ::1 you must manually set the Guacamole Proxy Parameters for every connection you create to point to ::1. If you have it listen on 127.0.0.1 you don't require any modification to that part of the config as it is the default. I don't understand why it can't listen universally on localhost and include ipv4 and v6.
Score:1
cn flag

Since this is still a high search result for the issue, guacamole 1.4 has moved the config location.

https://guacamole.apache.org/doc/gug/configuring-guacamole.html#configuring-guacd

So adding /etc/guacamole/guacd.conf

[server]

bind_host = 127.0.0.1
bind_port = 4822

Or other bind hosts will get back the ipv4 behaviour.

Score:0
cn flag

Since you are not asking for a workaround, but the full background:

  1. Check what addresses your bind_host (ie. "localhost") resolves to:
$ python3 -c "import socket
print(set([a[4][0] for a in socket.getaddrinfo('localhost', 4822)]))"

{'127.0.0.1', '::1'}
  1. Possibly open a new issue for guacd to properly implement support for dual-stack IPv4/IPv6 and allow specifying a bind_host which has multiple different addresses.

I did some work fixing IPv6-only support in guacd https://issues.apache.org/jira/browse/GUACAMOLE-1190 which was sufficient for my purposes.

Supporting proper IPv6 dual-stack in any TCP server, while also allowing the user to restrict binding to specific addresses means:

  • Create multiple sockets
  • bind() to all addresses returned by getaddrinfo() (127.0.0.1 and ::1 for "localhost")
  • listen() on all successfully bound sockets
  • Use select() or poll() to react to incomming clients on all bound sockets at once
  • Call accept() to accept a client connection after select() returns without error for a certain socket in the set

For reference see these answers/sites:

Semantics of :: and 0.0.0.0 in dual-stack OSes

How to support both IPv4 and IPv6 connections

select - synchronous I/O multiplexing

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.