mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

x11docker doesn't work when forwarding X #81

Closed gl4eqen closed 5 years ago

gl4eqen commented 5 years ago

Those are the logs, I picked example from wiki. Running x11docker locally works flawlessly but when ssh with X forwarding it fails. Links are log files I've captured.

Command used: ssh -X localhost -- /home/glaeqen/Documents/x11docker/x11docker --verbose x11docker/lxde lxterminal

Is my configuration flawed or am I doing something wrong? Thanks for help.

mviereck commented 5 years ago

Thanks for your bug report!

I can confirm and reproduce it here. It appears with option --hostdisplay that is used if no additional X server is available.

Workaround: If you install an additional X server like xpra, nxagent or Xephyr, your command above will work.

I did some first trials to fix the bug with --hostdisplay, but failed so far. I have to investigate that further. I'll report here when it is fixed.

gl4eqen commented 5 years ago

I have to investigate that further. I'll report here when it is fixed.

I appreciate fast reaction. However, it surprises me that such easy to reproduce bug wasn't found earlier. I keep thumbs up for resolving this issue. That mad scripting work you made is insane, good job.

mviereck commented 5 years ago

The bug is fixed in master branch. It seems that ssh -X does not set environment variable XAUTHORITY but uses the Xauthority file nonetheless. Without the cookie in Xauthority the authentication failed. Please check if it works for you now.

However, it surprises me that such easy to reproduce bug wasn't found earlier.

In previous tests this setup worked. I am not sure what may have changed; the bug may be new. However, many people don't write bug reports at all; but I need them to fix bugs I don't detect myself. Meanwhile x11docker has so much options that I cannot check all possible setup combinations. So, thanks again for reporting!

That mad scripting work you made is insane, good job.

thanks :-)

mviereck commented 5 years ago

I ran some tests with different ssh -X setups and found an odd issue with Xephyr (needed in x11docker for desktop option --xephyr):

This succeeds: ssh -X localhost -- Xephyr :15

But if I try a connection to a remote server different from localhost, Xephyr does not start up: ssh -X remoteserver -- Xephyr :15

Could you check this, too? Maybe it is a local issue only affecting my system, or it may be a general issue with Xephyr.

gl4eqen commented 5 years ago

I am really sorry for keeping you waiting and not responding, I've got a lot of chores to do. I'll try to perform some tests asap when I get some time.

gl4eqen commented 5 years ago

The bug is fixed in master branch. It seems that ssh -X does not set environment variable XAUTHORITY but uses the Xauthority file nonetheless. Without the cookie in Xauthority the authentication failed. Please check if it works for you now.

It works! Great job, thank you.

When it comes to Xephyr, X forwarding from localhost: localhost works as well as from different machine: different machine I guess it might be environmental issue in your case. Thank you once again.

mviereck commented 5 years ago

It works! Great job, thank you.

Glad to hear that. :-) I've published a new release v5.3.1 with this bugfix.

When it comes to Xephyr, X forwarding from localhost works as well as from different machine

Thank you for testing that! Good to know it is not a general issue. I'll investigate further.