I've installed Debian 8 since a week, but I can not run any graphical application from console with the root user. Infact, when I run xampp (or any other program) I get the following error

root# /opt/lampp/manager-linux-x64.run
No protocol specified
No protocol specified
Unknown Error couldn't connect to display ":0"

I've googled the error and tried any suggestion, but haven't solved the problem.

This is my Xauthority

root# echo $XAUTHORITY

This is my DISPLAY variable

root# echo $DISPLAY

The strange fact is that with my user (not the root one) I don't have any problem and I can run any graphical application. The DISPLAY variable is the same of the root one:

user# echo $DISPLAY

I also tried the suggestions here --> Why can't I run GUI apps from 'root': “No protocol specified”?:

root# xauth + root
xauth: (argv):1:  unknown command "+"

and the command

export XAUTHORITY=~/.Xauthority

doesn't have any effects

  • Maybe you mean xhost + instead of xauth +? Note that ~ is expanded in the home directory... so it depends on how you gain root. – Hastur Mar 1 '17 at 21:59
  • Thank you for your comment. I've tried both. Also with "xhost + root" I don't get any results. When I write "xhost + root" with the root user I get the error, meanwhile when I write it with the user I get "root being added to access control list", but nothing happen – DarkCoffee Mar 1 '17 at 22:04
  • 1
    Comment from one answer of your link: xhost + does work as a temporary measure before going in as sudo. Try this: open a terminal, write xhost +, gain the root access su -, try to run a graphic program (e.g. xlogo)... Sorry I've to go. – Hastur Mar 1 '17 at 22:13
  • Wow! It worked! Can you explain to me the meaning of the operations? Thank you! – DarkCoffee Mar 1 '17 at 22:17
  • I've restarted the pc and still the same problem as before. Is there a command to keep the configuration? – DarkCoffee Mar 1 '17 at 23:53

I only used xhost + then ran sudo ./manager-linux-x64.run and it came up for me.

| improve this answer | |

I've solved the problem using the command su -.

Here is the difference between su - and su

| improve this answer | |

You should properly use the xhost command. You could use either xhost +IP or xhost +Username.

For root user command you need to run is: xhost +root or for every user on localhost machine: xhost +localhost.

Finally you can run

$ xhost +

which will remove ACL from xserver temporarily.

You could read a manpage on xhost man xhost and see that it accepts one argument and you were passing two arguments + and username instead of 1 argument which is +username or +IP.

| improve this answer | |

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