Normal user can't startx xorg only root in debain?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
no, that is not the primary problem. I'm afraid we still do not really know what did you try exactly. The default installation usually works, you only need to start (by root) xdm/gdm/lightdm or another display manager, and a user can log in. Or a user will log in on a console and run startx. But I cannot find the reason. It looks like a permission issue, but .....
Hi Pan I tried to explain all the factors I've investigated I detailed them in a earlier post I'm not sure what further info you require ... ?
(I can't start xorg as a normal user only root.
I can login into tty and gdm accepted my user password but doesn't start the session
I have deleted created a new user with add user added to video and sudo group
Made sure all permissions for the files under ~/user belong to the user
Deleted the contents of tmp file including .(dot) files
Delete .Xauthority .ICEauthority
Removed /tmp/X.org
Tried startx --:1
Reinstalled gdm and xorg
Reconfigured Gdm
Checked that I'm level 5
Checked that anyone can start xorg
When I try to su to user logged in as root in the gnome session,and use gui programs I get the error can't open display.
I can startx from tty (alt+1) as ROOT ONLY.
Not with normal user.
I used tty login so I can grasp the error messages when I try starting xorg as normal user I can't!
If I try to login using gdm as an alternative I can again as root not user however the users password is recognised but I can't progress to the desktop ie to my system I a blank screen. Therefore I used tty login to see the error that's it
I have a /etc/X11/xinit/xinitrc?
I also tried making another new user using add user
And adding this account to sudoers and video I checked the ownership of the user belongs to user in home directory and there is a configured .xinitrc file for this user too but no luck. Only root can start xorg using either forms of login tty or gdm a " normal" user.
I have etc/xinit/xinitrc file
The reason I thought it's s permission problem is that a normal user with gnome session created by root can't start any gui applications the error is can't open display
I've tried logging as root starting /etc/init.d/gdm3 start the su to user and startx I get the same Error which is Xauthority timeout in locking authority file then a blank screen
I've managed to finally logon in gnome by playing with the options for the interface the user in gdm3 can login only using gnome on way land not classic or system default or cario dock
I know, I understand that you cannot start X, but your explanation is not enough to find the reason. Furthermore (for example) the command start -- :1 should contain 2 spaces, not only one, I do not know which one did you try. I still do not know if X --configure was checked. Also you can try a simple Xorg or X command to start gui (that will not display a usable screen, but you will see if X itself could be started).
So you should write exactly what have you tried and what was the response not only just a few words about that....
But when I say VET I mean the verb "to vet" meaning examine and alter the contents to remove private or protected information for instance, I have different logins per project or client and those names are discernible in that if I post a log someone can look and see those names, so when I post files or logs I check them and alter the names to be different.
Seeing these scripts and logs will assist us in helping you further.
Unsure if you feel you've solved this versus not, so if you do feel it was solved, perhaps list these options you modified to accomplish your goal.
Thanks pan for your reply.. command start -- :1 sorry my mistake, I did try with two spaces.
As I said in a earlier post I checked X -configure (1 hypen) (logged on as root in tty1 console) Error was EE server is already active for display 0.
Trying simple Xorg or X command to start gui produced the same error as above "server is already active for display 0".
I also Removed all my .Xauthority file same error
startx xinit /etc/init.d/gdm3 start is ok. (Returns me back to the login screen of tty as user)
sudo etc/init.d/gdm3 start (starting gdm3 (via systemcl) ok takes me to the gdm login screen here I can't use the windows manager options for system default, GNOME, however I can get to gui only using the window manager option of GNOME classic, Flashback & Wayland.
The main problem is that when I'm using root login in that xsession I su to user the user can't use any gui applications the error message is can't open display (I have tried export DISPLAY=:0 export DISPLAY=:0.0,
export DISPLAY=:10.0 export DISPLAY=localhost 0:0 etc (also using 127.0.0.1) checked my /etc/hosts file which is correct.
The file ~/.xsession-errors, return this message repeatly "cannot connect to br1tty at :0"
The file /etc/X11/xinit/xinitrc for the user (excluding all the commented out script) is . /etc/X11/Xsession
Therefore the primary problem isn't solved as still can't startx as user but I can get to a gui using different window managers such as wayland and flashback.
My main problem is that user can't open gui in a x-session logged into as root (can't open display ...
This is the main problem I've tried opening display using gksu etc.
Thank you for all your help
so actually X works, because you have already started a session. That is quite important. That means do not run X -configure any more.
You should know: the first graphical environment uses the display :0, the second one uses :1 and so on.
You need to allow access to the display, in general only the user logged in (started that X session) is allowed to use that.
the command startx xinit /etc/init.d/gdm3 start must not be executed, as you told it simply returns and does nothing ans is logically incorrect.
do not start X session as root, but as normal user. If :0 is already in use, you can try :1, :2 or whatever you want (the first free one). su will replace user (either from root or to root) and the new user is not allowed to connect to that display by default. If you want to change it do the following:
1. echo $DISPLAY will tell you the current display.
2. execute xhost+ to switch off access control.
3. execute su
4. set DISPLAY to the specified value (from the first point)
5. you will be able to use X as the new user too.
Yes X works, as I've been saying root can start xorg by startx etc...
the first graphical environment logged in as user can only start the x sessions with the window manager I stated above. Flashback wayland & classic only!
Trying to startx from user using 1, :2 etc.. Still gives me the same error I mentioned above
In a xsession started as root then su to user I tried this previously ,
1. echo $DISPLAY will tell you the current display. 0.0
2. execute xhost+ to switch off access control.
3. execute su
4. set DISPLAY to the specified value (from the first point)
5. you will be able to use X as the new user too.
Then I get the dbus error which I try solve which returns be to a error timeout in locking authority no d bus running or manager already started its nightmare! I've tried with gksu as well
Am I wasting my time will user never be able to start gnome default session I use for root?
ok, so first shut down any X session as root. You can do it by /etc/init.d/gdm3 stop, and check if any X, startx, xinit processes were still running.
Do you know which runlevel was booted? (just execute the command runlevel)
login as regular user.
in this case there will be only a single console opened. Delete ~/.xsession-errors. Now you can execute startx. please check/post the content of that file and also /var/log/Xorg.0.log
I shut down any X session as root. Powered off the system then logged into tty console as user excuted Sudo /etc/init.d/gdm3 stop,
The runlevel is 5
login as regular user.
Delete ~/.xsession-errors.
Same error messages in .xsession-errors open connection connect no such file or directory cannot connect to br1tty at :0 even by using startx -- :1 :2 etc..
Im wondering whether the profiles gnome and gnome default are owned by root that's why ?
The hassle is su to user in root xsession dbus is opened by root there apps don't work anyhow
so please show us exactly what did you enter, what was executed. like: as user executed sudo /etc/init.d/gdm3 stop
just copy and paste your screen and the content of the log files (~/.xsession-errors and /var/log/Xorg.0.log)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.