Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
can not open window from terminal as root user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
diablo465
Apprentice
Apprentice


Joined: 10 Sep 2013
Posts: 194

PostPosted: Wed Mar 26, 2014 12:12 pm    Post subject: can not open window from terminal as root user Reply with quote

I can not open application as root user in terminal. for example

Code:
localhost gchenming # gvim
No protocol specified
E233: cannot open displayE852: The child process failed to start the GUINo protocol specified
                                                                                             
Press ENTER or type command to continue


another example:
Code:
No protocol specified

(gedit:3398): Gtk-WARNING **: cannot open display: :0


There is no problem as a normal user.

I have another machine with gentoo installed using the same way, which does not have the same problem. So what have caused this?
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1374

PostPosted: Wed Mar 26, 2014 1:10 pm    Post subject: Reply with quote

I do su from Konsole like
Code:
su -
which I think catches the environment for root user: no problem here.
_________________
fun2gen2
Back to top
View user's profile Send private message
diablo465
Apprentice
Apprentice


Joined: 10 Sep 2013
Posts: 194

PostPosted: Wed Mar 26, 2014 1:46 pm    Post subject: Reply with quote

I found the problem still exist after using su -

Code:
gchenming@localhost ~ $ su -
Password:
localhost ~ # gedit
No protocol specified

(gedit:4658): Gtk-WARNING **: cannot open display: :0
localhost ~ #
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Wed Mar 26, 2014 8:50 pm    Post subject: Reply with quote

diablo465 ...

vim-sudo wrote:
This script eases use of vim with sudo by adding the ability to edit one file with root privleges without running the whole session that way.

Usage: put it in the plugin directory, and (command line) 'vim sudo:/etc/passwd', (within vim) ':e sudo:/etc/passwd'

see: vim-sudo

HTH & best ... khay
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13848

PostPosted: Thu Mar 27, 2014 1:36 am    Post subject: Reply with quote

This seems to be the correct and desirable behavior. The question is what is wrong with your other machine that you are using X11 applications as root.

The ability to run X11 programs as root is influenced by pam_xauth.
Back to top
View user's profile Send private message
diablo465
Apprentice
Apprentice


Joined: 10 Sep 2013
Posts: 194

PostPosted: Thu Mar 27, 2014 3:35 am    Post subject: Reply with quote

here are the outcomes from the machine that works well in opening gvim and gedit as root:

Code:

ae429-1105 Sew # gvim
Xlib:  extension "RANDR" missing on display ":0".

(gvim:22621): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::sm-connect after class was initialised

(gvim:22621): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::show-crash-dialog after class was initialised

(gvim:22621): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after class was initialised

(gvim:22621): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::default-icon after class was initialised
ae429-1105 Sew # gedit
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum