Solarid 10 - DISPLAY problem with GUI based applications when 'su -'

Hi guys,

I have solaris 10 on a workstation sunblade 150.I have problem running smc as root (su) when logged in as regular user. I get following error.

# /usr/sbin/smc &

[1] 878

#

It appears you are attempting to run the graphical

Solaris Management Console from a terminal which does

not have a suitable 'DISPLAY' environment. Please check

your 'DISPLAY' settings and that the user identity of

this terminal has access to the X server of this display.

# echo $SHELL

/sbin/sh

Changing DISPLAY did not help, still the same error:

# DISPLAY = hostname:0; export DISPLAY

# env|grep DISPLAY

DISPLAY=hostname:0

I also can not run xclock getting follwoing error:

xlib: connection to hostname:0.0 refused by server

xlib: client is not authorised to connect to server

error can't display: hostname:0

I also getcommand not found error (for regular userid and root both) when try commandxhost command.

NO luck so far.

Thanks for your help!

Mahima

[1108 byte] By [kaush28a] at [2007-11-27 10:50:30]
# 1

Don't use "su -", just use "su". When you use the -, all of your environment variables get reset to what root defaults to. Anything you had previously, like your X settings, are lost.

> su

# /usr/sbin/smc

Should work fine.

swilson-uca at 2007-7-29 11:25:39 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2

su instead of su - resolved my display problem.

many many thanks!

I still do not know why I had command not found error for xhost.

Mahima

kaush28a at 2007-7-29 11:25:39 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3

xhost lives in /usr/openwin/bin. If you don't have that in your path, you'll get that error.

However... nowadays I think if you have to use xhost you're probably doing something wrong. I just rely on SSH Xforwarding to handle all of that for me, and that tends to be both easier and more secure.

swilson-uca at 2007-7-29 11:25:39 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4

Good suggestions. Thanks Again for your help!

MK

kaush28a at 2007-7-29 11:25:39 > top of Java-index,Solaris Operating System,Solaris 10 Features...