Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use host's X11 socket to use GUI #3

Open
limerainne opened this issue Aug 21, 2018 · 1 comment
Open

Use host's X11 socket to use GUI #3

limerainne opened this issue Aug 21, 2018 · 1 comment

Comments

@limerainne
Copy link
Owner

limerainne commented Aug 21, 2018

After some research, there are some methods to enable X11 display inside the container.

Local display

Simple (insecure) method did not work in my (remote) environment (SSH + X11 forwarding). If yours are similar to my ones, then please try below.

Remote display with SSH forwarding (my situation)

StackOverflow by Ruben

  • assuming docker host's virtual NIC has IP as 172.17.0.1. If not, change the DISPLAY variable regarding your situation.

  • Let SSH daemon allow remote X11 connection (TODO insecure)
    /etc/ssh/sshd_config: X11UseLocalhost no

  • Make another Xauthority file

touch /tmp/.docker.xauth
XAUTH=/tmp/.docker.xauth
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | sudo xauth -f $XAUTH nmerge -
sudo chmod 777 $XAUTH
  • (I skipped configuring firewall (ufw)...)

  • Run the docker container with dedicated Xauthority file, modified DISPLAY variable

sudo docker run --rm -it \
        -e LM_LICENSE_FILE="<port>@<host>" \
        -e DISPLAY=$(echo $DISPLAY | sed 's/^[^:]*\(.*\)/172.17.0.1\1/') \
        -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH \
        synopsys_dc:N-2017.09 dc_shell -gui

hmm... is there an unified and somewhat official way?

@limerainne
Copy link
Owner Author

(Above commit referencing this issue was made by a mistake...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant