From 78f1f6746621f7d5b10d6506b4c9ea1b3f37cdee Mon Sep 17 00:00:00 2001 From: Ryan Eisworth Date: Sat, 8 Apr 2023 00:16:50 -0500 Subject: [PATCH 1/2] Update gen-xauth Filter the xauth list by the host system's hostname to prevent extra xauth list entries from breaking the xauth add command. --- scripts/gen-xauth | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen-xauth b/scripts/gen-xauth index 924fd89..bd5774b 100755 --- a/scripts/gen-xauth +++ b/scripts/gen-xauth @@ -10,7 +10,7 @@ mkdir -p $(dirname $XAUTH_FILE) # attempt to bring host DISPLAY/xauth to container rm -f $XAUTH_FILE && touch $XAUTH_FILE -DOCKER_XAUTH=$(xauth list $DISPLAY | awk '{print $3}') +DOCKER_XAUTH=$(xauth list $DISPLAY | grep $(uname -n) | awk '{print $3}') DOCKER_DISPLAY=$DISPLAY # assume that :# displays are TCP displays, use docker host IP as display in container From a29211852ceaab6f23b3f860b6938d6fba77be22 Mon Sep 17 00:00:00 2001 From: Ryan Eisworth Date: Sat, 8 Apr 2023 00:33:05 -0500 Subject: [PATCH 2/2] Update gen-xauth Change `hostname` command to `uname -n` for better compatibility. --- scripts/gen-xauth | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen-xauth b/scripts/gen-xauth index bd5774b..b9e99d4 100755 --- a/scripts/gen-xauth +++ b/scripts/gen-xauth @@ -15,7 +15,7 @@ DOCKER_DISPLAY=$DISPLAY # assume that :# displays are TCP displays, use docker host IP as display in container # this requres sshd_config option "X11UseLocalhost no" -if [[ $DISPLAY == $(hostname)* ]]; then +if [[ $DISPLAY == $(uname -n)* ]]; then DOCKER_DISPLAY="172.17.0.1:$(echo $DISPLAY | cut -d : -f 2)" fi