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

How to run in headless mode? #452

Closed
marisancans opened this issue Jun 30, 2022 · 4 comments
Closed

How to run in headless mode? #452

marisancans opened this issue Jun 30, 2022 · 4 comments
Labels

Comments

@marisancans
Copy link

Hi, how can I run this docker image in server where I don't have any display output? I just need to automate a GUI app and I want to use this image as base, when I run it I have to open GUI, do some automation and kill the image running. Thanks

@mviereck
Copy link
Owner

The most straightforward way is to use X server Xvfb with option --xvfb. This runs an invisible X server that does not depend on a monitor.

Xvfb does not support hardware acceleration. In case you need that you can try --xorg --gpu. If that does not work immediately, we could have a closer look.

@marisancans
Copy link
Author

marisancans commented Jun 30, 2022

Ok, now im getting some kind of a mount error which I can't fully understand. This seems to be docker related problem

g360@g360:~$ x11docker --desktop --xvfb --size 320x240 x11docker/mate                                                                                                                                            
x11docker WARNING: User g360 is member of group docker.
  That allows unprivileged processes on host to gain root privileges.

x11docker WARNING: Your host X server runs without cookie authentication.

x11docker note: Option --xc for X in container enabled automatically.

x11docker note: Option --xvfb: Enabling option --xtest.

x11docker note: Option --network=none is set to disable network access.
  If you need network and internet access, set option -I, --network [=NET].

x11docker note: check_screensize(): Could not determine your screen size.
  Please improve this by installing 'xrandr' or use option --size=XxY.
  You can look for the package name of this command at:
 https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages

x11docker note: setxkbmap not found. Need setxkbmap and xkbcomp to set keyboard layout.
  You can look for the package name of this command at:
 https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
  Alternatively you can provide image x11docker/xserver (option --xc).


x11docker ERROR: start_container(): Did not receive PID of PID1 in container.
  Maybe the container immediately stopped for unknown reasons.
  Just in case, check if host and image architecture are compatible:
  Host architecture: amd64 (x86_64), image architecture: amd64.

  Content of container log:
Error: No such container: x11docker_X114_x11docker-mate_96008302283
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /home/g360/.cache/x11docker/96008302283-mate/tmp/.X11-unix/X114.
See 'docker run --help'.
Error: No such object: x11docker_X114_x11docker-mate_96008302283

  Type 'x11docker --help' for usage information
  Debug options: '--verbose' (full log) or '--debug' (log excerpt).
  Logfile will be: /home/g360/.cache/x11docker/x11docker.log
  Please report issues at https://github.com/mviereck/x11docker

mviereck added a commit that referenced this issue Jun 30, 2022
@mviereck
Copy link
Owner

mviereck commented Jun 30, 2022

Ok, now im getting some kind of a mount error which I can't fully understand.

Ups, a bug in x11docker if using image x11docker/xserver.
I have fixed it now. Please update to current beta (x11docker --update-master) and try again.

EDIT: I've published release v7.3.1 that contains the fix. x11docker --update would be sufficient now.

@mviereck
Copy link
Owner

mviereck commented Jul 1, 2022

I've published release v7.3.1 that contains the fix. x11docker --update would be sufficient now.

Depending on how you want to run the automated tests, you might be interested in options --printenv and --printid to get access from outside to the container.

From x11docker --help:

Output of parseable information on stdout:
  Get output e.g. with: read xenv < <(x11docker --printenv x11docker/check)
  Optional argument FILE allows to print the information into a file.
     --printenv [=FILE]        Print variables to access new display.
     --printid [=FILE]         Print container ID.
     --printinfofile [=FILE]   Print path to internal x11docker info storage.
     --printpid1 [=FILE]       Print host PID of container PID 1.

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

No branches or pull requests

2 participants