Click to See Complete Forum and Search --> : launching programs from terminal


z0mbix
11-19-2001, 04:58 AM
I'm getting the following error when logged into X as a normal user but su'd to root in a terminal and try to launch a program from the command line:
Error: Can't open display:

I've searched google with this error and found a page telling me to use the following:

% DISPLAY=display_machine_name:0.0
% export DISPLAY

Error: Can't open display: zombix:0.0

I wanna run an xconsole, but need to be logged in as root!

If not, is there any way to run xconsole when a normal user other than using sudo?

Any ideas?

:confused:

Urko
11-19-2001, 03:44 PM
I don't know what xconsole is but you need to do this to run programs as other users from X

xhost +localhost <-- type this as normal user
su -

export DISPLAY=:0 or
export DISPLAY=localhost:0

The first line tell the x server to grant permission for people on the localhost to run programs. If you need more info " man xhost "
or " man X"

hiroku
11-21-2001, 04:33 AM
Originally posted by Urko:
<STRONG>I don't know what xconsole is but you need to do this to run programs as other users from X

xhost +localhost &lt;-- type this as normal user
su -

export DISPLAY=:0 or
export DISPLAY=localhost:0

The first line tell the x server to grant permission for people on the localhost to run programs. If you need more info " man xhost "
or " man X"</STRONG>

actually it works fine without the `export` commands Urko mentions. `xhost +localhost` (typed as the user, not as root), is enough to get you what you're looking for.