Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

when i try to acces the gedit as root user it shows the error like this:

root@localhost Downloads# gedit
No protocol specified
Cannot open display: 
Run 'gedit --help' to see a full list of available command line options.
share|improve this question
    
Are you logged in as 'root' at the time or are you logged in as another user (and that other, non-root, user have rights to write to the X display) ? –  Hennes Jun 17 '13 at 10:13
    
Give us some more info. Is your X working?Have you tried restarting :)? have you tried using some non graphic editors like nano,pico,vi,vim... –  mirkobrankovic Jun 17 '13 at 10:35

1 Answer 1

You can specify the display manually to run GUI applications in a session with different environments. To figure out which display is in use try ps a -o args | grep /[X] and see if you find an argument like :number (commonly :0). You should be able to run the application with that value, like this:

DISPLAY=:0 gedit
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.