Docker Community Forums

Share and learn in the Docker community.

UI Apps inside Ubuntu container cannot launch over SSH


(Tarekeldeeb) #1

Hello,

A friend of mine just sent me a container with some UI apps to show. That’s my first experience with docker, seems impressing. I managed to install, import the container and run using:

docker run -it --rm --privileged -v /tmp/.X11-unix:/tmp/.X11-unix:ro -v ~/.Xauthority:/home/user/.Xauthority -e DISPLAY=$DISPLAY -u user --name=APP APP:new /bin/bash

When I “ssh -X” to the host, the host can forward its X as expected, e.g. xclock works. But when I run the container from there, apps cannot access the UI. I get errors like:

Could not connect to display localhost:10.0
Aborted (core dumped)

How can I let the container forward X to ssh as well?


(Sam) #2

by default the xwindows port is not shared from the host to the container…
se http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/