vtkXOpenGLRenderWindow bad X Server connection

1k Views Asked by At

I'm attempting to run some scrimmage missions through a docker container on Ubuntu 22.04. I can walk through docker image/container setups in more detail if need be. Ran the container off the image with the following script:

xhost +local:root
docker run -it \
    --ipc=host \
    --name $2 \
    --env="DISPLAY" \
    --env="QT_X11_NO_MITSHM=1" \
    --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
    --privileged \
    $1
xhost -local:root

After attaching the container and attempting to run a mission I get the following error:

ERROR: In /build/vtk7-yd0MKW/vtk7-7.1.1+dfsg2/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 300
vtkXOpenGLRenderWindow (0x5590cbbf87d0): bad X server connection. DISPLAY=:1. Aborting.

Aborted

I suspect this might have to do with the X11 forwarding setup, although I don't know how to troubleshoot that. Already referenced the following two posts from online searches:

"Can't use X server on Ubuntu #1 ": https://github.com/lukin0110/docker-vtk-python/issues/1

"Docker Display GUI with X Server": https://www.mit.edu/~arosinol/2019/08/06/Docker_Display_GUI_with_X_server/

Any tips?

0

There are 0 best solutions below