X11 forwarding over SSH to run Holoviz remotely


I tried to run my holoscan application remotely over SSH. I did configure X11 forwarding on the server (clara holoscan devkit).

The sshd_config file on the server looks like this:

AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no

On the client (local computer) I run the following command:
ssh user@address -v -AX

The debug information returns that forwarding is activated. I can open any graphical application (e.g. xterm ) on the server without any issue. From inside a container on the server, however, I get the following error when running an application which uses holoviz:

Glfw Error 65544: X11: Failed to open display localhost:12.0
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to initialize glfw
Aborted (core dumped)

I ran the container following your guide with --net host, -v /tmp/.X11-unix:/tmp/.X11-unix and -e DISPLAY=$DISPLAY.

Do you know how to set the display inside the container such that holoviz window is forwarded?

Any help would be much appreciated.

Disclaimer: this is not an officially tested solution. I have had success previously with forwarding from within a container on a remote server by a solution I found online

xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | sudo xauth -f $XAUTH nmerge -
sudo chmod 777 $XAUTH
# minimal docker container to test forwarding:
docker run -ti -e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --net host ubuntu:latest

Similarly when running the Holoscan container, I add the following to the docker run command: -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH.

Let us know how this work out!

The suggested approach works quite well. Thanks for the help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.