root-project / root-docker

Docker recipes for ROOT
30 stars 33 forks source link

Suggested command to run the containers with graphics does not work on archlinux #28

Closed eguiraud closed 3 years ago

eguiraud commented 3 years ago
[blue@marvin ~]$ echo $DISPLAY                                                                                                                                                
:0          
[blue@marvin ~]$ docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --rm -it --user $(id -u) rootproject/root root                                               
   ------------------------------------------------------------------                                                                                                         
  | Welcome to ROOT 6.20/06                        https://root.cern |                                                                                                        
  | (c) 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |                                                                                                        
  | Built for linuxx8664gcc on Jun 10 2020, 06:10:57                 |                                                                                                        
  | From tags/v6-20-06@v6-20-06                                      |                                                                                                        
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |                                                                                                        
   ------------------------------------------------------------------                                                                                                         

root [0] TBrowser b                                                                                                                                                           
No protocol specified                                                                                                                                                         
Error in <TGClient::TGClient>: can't open display ":0", switching to batch mode...                                                                                            
 In case you run from a remote ssh session, reconnect with ssh -Y                                                                                                             
(TBrowser &) Name: Browser Title: ROOT Object Browser                                                                                                                         
root [1]                                                                
eguiraud commented 3 years ago

Seems to work at least on CentOS 7 though.

amadio commented 3 years ago

Does it work after running xhost +?

eguiraud commented 3 years ago

Yes! Thanks!

amadio commented 3 years ago

xhost + is quite the sledgehammer solution, maybe we could make a better suggestion. I just wanted to eliminate this from the possibilities when I suggested to you to check.

eguiraud commented 3 years ago

I'm trying to figure out what is the generic linux-wide equivalent of the xhost command we suggest for mac, but i'm not sure what ip we need exactly