FILM
FILM copied to clipboard
can run Xorg without sudo?
[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?
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)
@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:
- Tried display > 0 as suggested here: https://github.com/askforalfred/alfred#cloud-instance
- Fixed https://github.com/askforalfred/alfred/issues/29#issuecomment-866774654 by adding
allowed_users=anybodyat the end of/etc/X11/Xwrapper.config - Fixed https://github.com/askforalfred/alfred/issues/51#issue-714415967 with
DEBIAN_FRONTEND=noninteractive - Looked at https://github.com/askforalfred/alfred#run-headless, but since I didn't have root access, I couldn't run
nvidia-xconfig. - Looked at https://github.com/askforalfred/alfred/issues/61 but since I just login inside a container that is automatically launched from my docker image, I can't use
--privileged. - Tried different ways to install Xorg:
xorg openbox(stackoverflow) vsxserver-xorg-core xorg(ai2thor docker) vsxserver-xorg xserver-xorg-video-fbdev xauth(alfred). - Checked that
tempfileis not used instartx.pyhttps://github.com/allenai/ai2thor/issues/325#issuecomment-853924515 - Tried https://github.com/dnschneid/crouton/issues/3339#issuecomment-325223722
- Fixed
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be createdby 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.
@TopCoder2K Thank you very much for taking the time to answer my questions