faq How to enable X11 forwarding to display HazelcastDesktop and PadoDesktop - padogrid/padogrid GitHub Wiki

How to enable X11 forwarding to display HazelcastDesktop and PadoDesktop?

First, install X11 on your local machine if you haven't done so.

Oracle Linux

# ssh into your remote machine
ssh -i private.key [email protected]

# install xauth
sudo yum install xorg-x11-xauth

# Generate .Xauthority
touch ~/.Xauthority
xauth generate :0 . trusted

To enable X11 forwarding, specify the -X option as follows.

# From your local machine, ssh into the remote machine
ssh -i private.key -X [email protected]

# From the remote machine, run GUI apps
create_app -product hazelcast -app desktop
cd_app desktop/bin_sh
./desktop

You should see the desktop display on your screen.

PadoGrid Container

macOS:

Install and run socat that "establishes two bidirectional byte streams and transfers data between them".

# Install socat
brew install socat

# Start socat first before Xquartz
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

# Start Xquartz
open -a Xquartz

PadoGrid Container:

Start the PadoGrid container with the DISPLAY enviroment variable, DISPLAY, your host OS address.

# Start PadoGrid container
docker run --name padogrid -h padogrid -d \
   --mount type=volume,source=padogrid,target=/opt/padogrid \
   -p 8888:8888 -p 5701:5701 -p 5702:5702 -p 5703:5703 -p 8080:8080 \
   -p 9401:9401 -p 9402:9402 -p 9403:9403 -p 3000:3000 -p 9090:9090 \
   -e PADOGRID_HTTPS_ENABLED=true \
   -e DISPLAY=192.168.1.10:0 \
   padogrid/padogrid

# Login to the container
docker exec -it padogrid /bin/bash

From inside the container, install the X11 server and run your GUI apps.

✏️ The following works with padogrid/padogrid:0.9.28+ images which include X11 client packages. Starting 0.9.28, PadoGrid Docker images are built on Ubuntu instead of Alpine in order to provide better support for Python and AI/ML bundles.

Ubuntu

From your host OS get by running the following.

xauth list

Output:

myhost.local/unix:0  MIT-MAGIC-COOKIE-1  2a7842352bdc123b2cf92c01bf0e822b

Copy the entire line of the output of xauth list.

From inside the container execute the following.

# Install xauth and add your token to .Xauthority
sudo apt install -y xauth
touch ~/.Xauthority

# Add the copied line to .Xauthority. Depending on your Docker environment, you may
# need to replace the host name, e.g., `myhost.local/unix` with the host IP address.
xauth add myhost.local/unix:0  MIT-MAGIC-COOKIE-1  2a7842352bdc123b2cf92c01bf0e822b
xauth list

# Run your GUI app
install_padogrid -product hazelcast-desktop
update_padogrid -product hazelcast-desktop
create_app -product hazelcast -app desktop
cd_app desktop/bin_sh
./desktop

You should see the desktop display on your screen.

Alpine

# Install X11 server
sudo apk add xfce4 lxdm mesa-dri-gallium

# Run your GUI app
install_padogrid -product hazelcast-desktop
update_padogrid -product hazelcast-desktop
create_app -product hazelcast -app desktop
cd_app desktop/bin_sh
./desktop

You should see the desktop display on your screen.

References

  1. Running GUI's with Docker on Mac OS X, https://cntnr.io/running-guis-with-docker-on-mac-os-x-a14df6a76efc
  2. Install X-Window in Alpine Linux, https://troglobit.com/2017/09/10/install-x-window-in-alpine-linux/
⚠️ **GitHub.com Fallback** ⚠️