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

can run Xorg without sudo? #3

Open
hcscctv opened this issue Apr 5, 2022 · 3 comments
Open

can run Xorg without sudo? #3

hcscctv opened this issue Apr 5, 2022 · 3 comments

Comments

@hcscctv
Copy link

hcscctv commented Apr 5, 2022

[3147052.780] (II) xfree86: Adding drm device (/dev/dri/card1) [3147052.781] (EE) systemd-logind: failed to take device /dev/dri/card1: Operation not permitted

[3147052.825] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)

can the Xorg run without root permission?

@soyeonm
Copy link
Owner

soyeonm commented Apr 11, 2022

Hello, sorry for my late reply. I think it requires "root" although not sudo.
Inside a docker container, you can be the root and if you turn on xserver inside the container, you will have permission (even if you don't have root access for the computer itself)

@TopCoder2K
Copy link

TopCoder2K commented Apr 13, 2022

@hcscctv, after many hours of trying It seems to me that if you don't have root access inside docker, then running Xorg server is impossible.

What have I tried and looked at? I've gone through every issue related to Xorg in the Alfred and AI2Thor repositories. More specifically, I:

  1. Tried display > 0 as suggested here: https://github.com/askforalfred/alfred#cloud-instance
  2. Fixed Unable to find X server when running evaluation askforalfred/alfred#29 (comment) by adding allowed_users=anybody at the end of /etc/X11/Xwrapper.config
  3. Fixed Can't run startx.py inside docker — requires lspci (fixed) and Xorg (UPDATE: fixed) askforalfred/alfred#51 (comment) with DEBIAN_FRONTEND=noninteractive
  4. Looked at https://github.com/askforalfred/alfred#run-headless, but since I didn't have root access, I couldn't run nvidia-xconfig.
  5. Looked at Unable to run on headless server askforalfred/alfred#61 but since I just login inside a container that is automatically launched from my docker image, I can't use --privileged.
  6. Tried different ways to install Xorg: xorg openbox (stackoverflow) vs xserver-xorg-core xorg (ai2thor docker) vs xserver-xorg xserver-xorg-video-fbdev xauth (alfred).
  7. Checked that tempfile is not used in startx.py Fail to start the controller with X11 forwarding enabled allenai/ai2thor#325 (comment)
  8. Tried (EE) parse_vt_settings: Cannot open /dev/tty0 (No such file or directory) dnschneid/crouton#3339 (comment)
  9. Fixed _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created by editing the command to run Xorg (added -nolisten unix)

So, it seems the problem is in having access to /dev/tty0. This device is a virtual console that can be used for running a display. Only system and root users are allowed to write inside it. Moreover, if you run without --privileged, it doesn't show up in /dev/ (I checked this locally). Also, when I tried to run Xorg inside a locally running container (launched with --privileged), my display turned black, thus Xorg was successfully launched.

@hcscctv
Copy link
Author

hcscctv commented Apr 13, 2022

@TopCoder2K Thank you very much for taking the time to answer my questions

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

3 participants