PDA

View Full Version : $DISPLAY question



smarchand291
06-13-2004, 05:05 PM
8) Greeting again !

I want to use xconsoleto (keep an eye on logs.
but when starting the apps. from a shell,
keeps telling me :
dah@home:/# xconsole
Error: Can't open display:

I got the same result for a bunch of other X
apps. ?!?

How can I resolv this problem ?

Thanks

tearinghairout
06-14-2004, 02:04 AM
This could be the result of one of two (or possibly both) things.

Firstly, you need to have an environment variable called DISPLAY set to tell the X programs where to draw themselves. This should be set when you are first logged in, but often when you su to root this is not set in the root shell. This is normally set to ":0.0" which means the first display on the local machine. You can double check what the value should be by echoing the value of $DISPLAY before you su to root.

However, when you have done this, it is possible that you will get an error about the connection being refused by the server. In order to fix this, you must run the xhost command to grant access permissions to your display. This must be done before you su to root. It should be possible to run something like "xhost localhost" which will allow access to any program running on your local machine, but I couldn't seem to get this work. You can also do "xhost +" which basically completely disables any sort of access control.
WARNING, doing xhost + is a security risk if your computer is connected to any sort of a network because it basically allows open access to your machine.

smarchand291
06-14-2004, 06:53 PM
Follow up on the problem with $DISPLAY

When doing a "su -"
and trying to start any apps. in a shell, error cannot connect to display.
but when executing the apps. from under the original user account
everything seems to work fine ...

but I have problem with video4linux, camserv seems to not
work properly :-S

please help

Markus
06-14-2004, 07:23 PM
For some security reasons X only allows one connection at a time. You can either do: kdesu appname to run it as root or create a workaround with:
ln -s /home/your_username/.Xauthority /root/.Xauthority
Sorry, not a clue about camserv. Any error messages on that one?

smarchand291
06-14-2004, 09:03 PM
no error from camserv, even if I start the process using
a 'usual' account. (not admin / root) and nothing
comes up onthe webpage...