Root can't open display, but normal user can?
Hi,
I'm using Slackware 10.1 with a 2.6.10 kernel. If I load up Fluxbox (or KDE, whichever GUI it doesn't matter), load up a terminal and run something like xine, it works perfectly in my user. However, if I go su and then try and run xine (or anything that tries to use X) I get an error message: Xlib: connection to ":0.0" refused by server Xlib: No protocol specified Cannot open display Any ideas? I need to be able to run programs as root in the GUI really. Thanks |
Had this problem in debian as well.
The best solution would be to use sux (su in X) or su-to-root (or any other graphical su like gksu, kdesu and so on). |
you can also type " xhost + " in a console as user.
that gives others permission to use the graphics. egag |
Quote:
But both methods should work well for you. Just remember to run the xhost + every time you reboot or save this in your bootup script in /etc/rc.d. |
kde already has a "run as root" GUI interface.
but yeah, basically i would normally do the xhost command mentioned above as it can be tedious typing the root password many times. |
Or this better way:
export DISPLAY=:0 #assuming it wasn't set already xauth merge ~user_in_x/.Xauthority Also "xhost +local:" is better than just "xhost +", but not as good as the above. The above xauth command only allows root to use X, "xhost +local:" allows anyone locally at the computer, "xhost +" allows anyone who can connect to your computer. And the xauth usually only works as root and the xhost only works as the user currently in X. |
Just wanted to add, I'm sure you must know this, but just in case, you can startx as root. And if you've display 0 running with your user, you can use startx -- :1 to open another X server (can access it with CTRL+ALT+F8).
|
All times are GMT -5. The time now is 02:30 PM. |