I'd like to run a containerized GUI application from a remote machine.
I don't want to solve this problem by adding an ssh host to the container because
- I already have access to the host machine over SSH
- It adds unnecessary overhead
- It makes the container non-portable between remote and local use
I can already successfully run GUI apps on the host, but not from within the container. These are the steps I've taken so far:
xauth +(not for long term, but useful for eliminating possible problems)
docker-userwith uid 501000 on host ==
docker-userwith uid 1000 in container via namespace feature
.Xauthorityfile copied to
- Based on alpine
xauthand, for testing purposes,
docker-userwith proper uid/gid
- Environment variable
/tmp/.X11-unix:/tmp/.X11-unix:roto provide X11 socket access
- Runs command
su - docker-user -c "export DISPLAY=$DISPLAY && xterm"
suused to run as
Unfortunately, this is not yet enough. While xterm on the host OS connects to my local X server without issue, xterm in the container says
Xt error: Can't open display: localhost:10.0.
I've confirmed that "localhost:10.0" is correct, localhost exists in the container's
/etc/hosts, and the cookie and socket are making it through with the right permissions.
What else could possibly be going wrong?