You are not logged in.
hey,
somehow, i can't start any GUI applications from command line as root anymore. The $DISPLAY variable is empty which might be the reason or at least connected to the problem.
It works perfectly fine as normal user and i can even use sudo to start GUI software with root priviliges. But as soon as i want to do it directly as root, nothing happens.
I just set up a brand new system and i am using systemd, then autologin via agetty on tty1 and triggering startx via .zprofile (zsh). my .xinitrc reads exec awesome.
Any idea how to give my root display access from shell again?
Thanks
P.S.: I think what i need might be multi user support for xorg. I'd be glad if someone could give me a hint, i'm having trouble finding info on that.
Last edited by demian (2013-11-05 14:00:01)
no place like /home
github
Offline
Why do you want to do this in the first place?
https://wiki.archlinux.org/index.php/Ru … ps_as_root
Offline
yeah, it's bad practice, i know. it's just lazyness on my part. i'll try that article, thanks!
no place like /home
github
Offline
okay i tried everything in that wiki article including the discussion part.
The problem is in fact the $DISPLAY variable. It won't stay for root.
Right now, the only way it works if i prepend any GUI action as root with DISPLAY=:0, e.g. DISPLAY=:0 medit .zshrc
i'll have another look around the web, hopefully i can mark this solved, soon
no place like /home
github
Offline
Iqm assuming you're logging in as a "normal" user, so how are you switching to the root user? Are you using one of the methods described in the wiki page that Karol linked?
Do you have anything in root's shell config files that may be unsetting the DISPLAY variable when they're sourced?
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
i'm switching to root via su.
somehow, it works now. i did pretty much everything described in the wiki article and then once again exported DISPLAY=:0 in my roots .zshrc (which didn't work before at all).
But i still find it curious. I never used to have to explicitly export DISPLAY as root to have X access. Oh, well, marking as solved. Thanks everyone.
Last edited by demian (2013-11-05 14:01:35)
no place like /home
github
Offline
Why not use gksu to run gui applications as root?
Offline
Why not use gksu to run gui applications as root?
I dont think you can run gksu if you are already logged in as root (which was the situation in question).
no place like /home
github
Offline
I suppose my question is why you use a root shell rather than stay in a user shell and just use gksu?
Offline
Why not use gksu to run gui applications as root?
I never used gksu but gksudo. Any objections why I should use gksu over gksudo or are they basically the same?
Offline
gksudo uses sudo as a backend, gksu uses su. It depends on your personal preference.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Offline
That's strange. What behaviour do you experience with gksu? Do you get an error or anything? Can you use 'su' by itself?
gksudo is just a symlink to gksu, there shouldn't be that big a difference in behaviour between the two.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
You should probably open a new topic about it if you want to get to the bottom of it, it's not going to get a lot of attention in this solved topic. You could try running it with strace to see if that reveals anything.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline