Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
Sounds like the X server is running - it was startx-ed by someone else.
Any other user ( not even root) cannot USE the services offerered by the X server unless the client program authenticates with the server. Unless, we have the MIT-MAGIC-COOKIE in the server user's ~/.Xauthority. this is the cookie that the Xserver starts with and all clients are supposed to use to connect to it.
Since it is root who wants to connect, and root can read any file in the system it that makes it a li'l easier for you to deal with this.
Run the command as root right before you run the x client prog. You are extracting the cookie that the X server was instructed to authenticate with ( when someguy started the server ) and adding it to root's cookie file.
xauth -f ~someguy/.Xauthority list :0.0 | awk '{ printf("add :0.0 . %s",$NF); }' | xauth -q
see man xauth
I have discovered that this happens if you use kdm or xdm (haven't tried with gdm). When i used login.app i didn't have this problem, but if i used xdm it appeared.
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
To allow other users (even root) to access your X session, use:
xhost +localhost
Then make sure your other user has their environment DISPLAY set
correctly (looks like it above) by either:
setenv DISPLAY localhost:0.0
or
export DISPLAY=localhost:0.0
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.