The officially official Devuan Forum!

You are not logged in.

#1 2020-03-18 21:59:34

Roger
Member
From: Vancouver, BC, Canada
Registered: 2019-04-06
Posts: 67  
Website

[SOLVED] Running X11 as non-root user

From my research on the web this appears to be a classic problem, but the suggested solutions are less than ideal, or do not work for me. I am setting up a new desktop machine as a potential backup or replacement for two others that have been running continuously for eight years or so. I am mainly interested in programming, and write my own software for some video applications and record keeping. The typical desktop environments do not appeal to me as they all seem to be attempts to make Linux machines look and behave like windows, and if it's GNOME even preventing the user from being able to take control. So, I run fvwm and xterms with most things available on drop-down menus. My procedure on other machines has been, for many years, to let myself, not as root, be the principal operator, and the person that starts an .xinitrc script that all other processes hang from. If I want to be root, or any other user, I set up xterms for them.

The problem with the new machine is errors such as "parse_vt_settings: Cannot open /dev/tty0 (Permission denied)"; making myself a member of the tty, input, and video groups does not help. The suggestions frequent on the web are to change the file permissions for all the /dev/tty? files; that is somewhat drastic, and does not seem to work, and in any case permissions get changed depending on which user does the first login. There is a suggestion on the gentoo website that seems a likely cause of my problem. Apparently the xorg people changed a default involving sudo in their generic device driver, and apparently users with nvidia and intel drivers avoid the problem. I have tried to make an entry in xorg.config.d for the intel driver, but that doesn't seem to work; maybe I have to download a driver from Intel and not use the one supplied by xorg.

I would appreciate any insight members of this forum could give me. In the meantime (reluctantly) I can continue with my testing and tailoring using sudo. That complicates things as it messes up paths and directory references.

Last edited by Roger (2020-03-19 00:11:08)

Offline

#2 2020-03-18 22:43:31

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,251  

Re: [SOLVED] Running X11 as non-root user

I don't know much about this, but my first guess would be that X is actually started via the Xorg.wrap program, which has its configuration file at /etc/X11/Xwrapper.config, and this has a line

allowed_users=console

that probably should be different.

My suggestion comes from the shallow investigation:

find /usr -perm /u=s

followed by some guess work, which made me look at man Xorg.wrap.

HTH

Offline

#3 2020-03-18 23:54:15

Roger
Member
From: Vancouver, BC, Canada
Registered: 2019-04-06
Posts: 67  
Website

Re: [SOLVED] Running X11 as non-root user

That may be the problem, as there is a default setting "needs_root_rights=auto" and what auto decides depends on the video card. I experimented with the setting "no", but I think that is the reverse of what I want. I'll experiment more later. I am optimistic about this because all the machines have identical software and settings, so the video card is a likely source of difference.

Offline

#4 2020-03-19 00:10:24

Roger
Member
From: Vancouver, BC, Canada
Registered: 2019-04-06
Posts: 67  
Website

Re: [SOLVED] Running X11 as non-root user

It is indeed the problem! Adding a line "needs_root_rights=yes" to Xwrapper.config fixes things so that user roger can start X11. I am pleased with this outcome, not just because an annoying problem has been solved, but because I understand the cause and it makes sense. The only difference between the machines running my script and one that wouldn't was the video card, and apparently that makes the decision about rights when the auto setting is used.

Thanks for the quick and helpful response Ralph.

Offline

Board footer