Unable to see game being played via X11 when running from Docker container


#1

I am using Ubuntu 16.04 as my development environment. When I install universe and all the pre-reqs directly into Ubuntu, I am able to run the “Run your first agent” script (here, test.py) and get a pop-up with a Chrome browser showing me the game.

When I build the docker image from the included Dockerfile (https://github.com/openai/universe/blob/master/Dockerfile) and run it with the same script, no pop-up appears. I am able to view the game by opening a web browser and viewing it over VNC, but this is not ideal for me. Does anyone know how to get the games to appear in X like the natively run script?

I’ve tried several different methods of getting this to work without success. These are the commands I’m running with:
xhost +
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
chmod 644 $XAUTH
xauth nlist :0 | sed -e ‘s/^…/ffff/’ | xauth -f $XAUTH nmerge -
docker run --privileged --rm -e DOCKER_NET_HOST=172.17.0.1 -v /var/run/docker.sock:/var/run/docker.sock -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --v $PWD:/media universe python3 /media/test.py

Thanks!