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 can't find window manager (--wm) even the image is installed and tested #200

Closed sxiii closed 4 years ago

sxiii commented 4 years ago

Latest issue (maybe bug!) I found with using both --wm=openbox and wm=x11docker/openbox:

bash: storepid: command not found
x11docker note: Option --wm: Did not find window manager image 
      openbox 
  to provide a containerized window manager. Please run: 
      docker pull x11docker/openbox 
  If you want to use a host window manager instead and avoid this warning, 
  use option                         --wm=host  or  --wm=COMMAND 
  or provide a local image with e.g. --wm=x11docker/lxde 
  To run without a window manager:   --wm=none  or  --desktop 
  Fallback: Will try to run a host window manager: 

x11docker note: Did not find a host window manager. 
  Please pull image x11docker/openbox or provide one of: 
  amiwm blackbox cinnamon compiz ctwm enlightenment fluxbox flwm fvwm jwm kwin kwin_x11 lxsession mate-session mate-wm marco metacity notion olwm olvwm openbox ororobus pekwm sawfish twm wmaker w9wm xfwm4

x11docker note: Option --wm: Starting host window manager: WM_NOT_FOUND

x11docker note: Failed to add container user to group render.

I was already running openbox earlier. The only thing is that I've changed Dockerfile a little bit. Here you can see that I have the image:

ubuntu@ip:~/nvdc$ docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
nvdc                    superlight          b1c7281640c5        13 minutes ago      1.12GB
x11docker/openbox       latest              aa7c84c1049d        6 months ago        32.6MB
sxiii commented 4 years ago

It seems that this error has something to do with my DISPLAY="" variable. When I set it up like export DISPLAY="" then it works. When I do export $Xenv after running a session it's getting filled with data from docker, and later I can't start it until I make DISPLAY empty again.

mviereck commented 4 years ago

I am not sure what is going on. Can you please provide me ~/.cache/x11docker/x11docker.log or the --verbose output?

sxiii commented 4 years ago

Here's the file: error.log Doing export DISPLAY="" helps to get rid of this problem. But if the DISPLAY has something in it; then there's error of not being able to access the XServer, even tho it's not launched.

mviereck commented 4 years ago

Maybe I already found the issue in your command:

'/usr/bin/x11docker' '--verbose' '--name=ff' '--gpu' '--xorg' '--size=1920x1080' '--display' '11' '--showenv' '--hostipc' '--hostdisplay' '--user=RETAIN' '--wm=x11docker/fvwm' '-m' '--' 'ff' 

You specify --xorg --hostdisplay. Those are two different X server options, the second one (--hostdisplay) takes effect. If you previously ran export $Xenv there will be some confusion.

--xorg runs a new X server. --hostdisplay uses an already running X server, e.g. one with a regular desktop environment.

Try either with --xorg (or --xorg --wm) only, or provide a regular X enviroment that already provides a window manager to use --hostdisplay (without --wm).

sxiii commented 4 years ago

Aha. Now I got the idea. Second one is more important; --xorg -> for new X; --hostdisplay for "reusing existing". That wasn't clear! I am trying to get rid of the flags I don't really need. So thanks!

mviereck commented 4 years ago

Does --wm now work as expected, or are still issues left?

sxiii commented 4 years ago

@mviereck yeah I managed to pick the right sets of flags. I think WM works as expected so closing the issue :) Thanks.