Operating System - HP-UX
1819791 Members
3451 Online
109607 Solutions
New Discussion юеВ

Unable to run xclock from oracle

 
Nilesh Naik
Advisor

Unable to run xclock from oracle

I able to run xclock by ssh client software (Putty / CygWin) by root login but when switch to i created user oracle then i get error:Can't open display. What parameter i have to set in oracle user environment (Profile).
26 REPLIES 26
Deepak Kr
Respected Contributor

Re: Unable to run xclock from oracle

Hi,

export correct display paramters it should work

example:

export DISPLAY=:0.0

"There is always some scope for improvement"
skt_skt
Honored Contributor

Re: Unable to run xclock from oracle

export DISPLAY=:${DISPLAY NUMBER}.0
OldSchool
Honored Contributor

Re: Unable to run xclock from oracle

If you ssh in as root, then su to oracle, you will need to authorize the display as well.

The script below does this. Assuming you save it as "disp_auth.sh", while still root, your would run "disp_auth.sh oracle" and then "su - oracle" followed by setting / exporting the DISPLAY variable as it was when you were root.


!/usr/bin/ksh

if [ "$1" != '' ]
then
echo
AUTH=/usr/bin/X11/xauth
outfile=${HOME}/`whoami`.disp

echo $AUTH -i add `$AUTH list | tail -1` > ${outfile}
echo export DISPLAY=$DISPLAY >> ${outfile}

chmod 755 $outfile
su - $1 -c "${outfile}"
else
echo 'Usage: disp_auth.sh '
fi

OldSchool
Honored Contributor

Re: Unable to run xclock from oracle

Follow-up

if using ssh and su'ing to oracle, echo $DISPLAY while still root. You will need to set/export this value when you are oracle. It will appear either as
::0 or
localhost::0

the offset is determined by ssh config
Nilesh Naik
Advisor

Re: Unable to run xclock from oracle

script is not work on server it says error line 1

also we tried export display but that also not work.

export DISPLAY=:0.0
i tried with above command
OldSchool
Honored Contributor

Re: Unable to run xclock from oracle

"script is not work on server it says error line 1"
sorry, should read:

#!/usr/bin/ksh


"also we tried export display but that also not work.

export DISPLAY=:0.0
i tried with above command "

Are you logging in as root using ssh? Are you then "su"ing to oracle? If yes to both, then what does "echo $DISPLAY" when run as root yield?
Nilesh Naik
Advisor

Re: Unable to run xclock from oracle

Yes I am login as a root using ssh then su├в ing to oracle.
When I echo $DISPLAY from root it shows {localhost:10.0}
and same when I run from oracle it shows {-bash: DISPLAY: unbound veriable}
skt_skt
Honored Contributor

Re: Unable to run xclock from oracle

is the Xserever running?
Nilesh Naik
Advisor

Re: Unable to run xclock from oracle

Yes and i checked that by running xclock.
OldSchool
Honored Contributor

Re: Unable to run xclock from oracle

so, after su'ing to oracle, enter

export DISPLAY=localhost:10.0

then try xclock. If you get a message about like
"Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match
Error: Can't open display: localhost:10.0
Error: Couldn't find per display information"

then you need to authorize the display as described above
skt_skt
Honored Contributor

Re: Unable to run xclock from oracle

i had seen simialr error from oracle program? restart the Xsever and relate application( if required).
Nilesh Naik
Advisor

Re: Unable to run xclock from oracle

As you mentioned above I saved the file & done all the same but when i run the script ./disp_auth.sh oracle its giving the error for ./disp_auth.sh line 1 !/usr/bin/ksh: No such file or directory
Vadsys
New Member

Re: Unable to run xclock from oracle

Does the first line in your script start with a hash(or pound)-viz # ?

it should be #!/usr/bin/ksh



Oviwan
Honored Contributor

Re: Unable to run xclock from oracle

hey

first with root, execute:
xhosts + (maybe no required)

then
su - oracle
export DISPLAY=localhost:10.0
xclock

then if the clock appears it works. so you can try to execute your script.

it would be also helpful if you would provide the content of you script.

regards
Nilesh Naik
Advisor

Re: Unable to run xclock from oracle

I already done this and I get the followed error:

Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match
Error: Can't open display: localhost:10.0

I trying to run oracle runInstaller from my Putty.
Oviwan
Honored Contributor

Re: Unable to run xclock from oracle

i don't whether a X session can be run by putty.

but usually you have to connect with exceed or cygwin etc..

exceed:
http://connectivity.hummingbird.com/products/nc/exceed

cygwin:
http://www.cygwin.com/

regards
Nilesh Naik
Advisor

Re: Unable to run xclock from oracle

I also tryed Cygwin buti get same error mseg.
Deepak Kr
Respected Contributor

Re: Unable to run xclock from oracle

Hi,

What about Xmanager

this is very good product...you can download and work without exporting display at all.

Try while issue resolved....

"There is always some scope for improvement"
Deepak Kr
Respected Contributor

Re: Unable to run xclock from oracle

>>>Error: Can't open display: localhost:10.0


Why are you using 10.0 here....have you tried with other display...

like 3.0 or 4.0 etc..

"There is always some scope for improvement"
Deepak Kr
Respected Contributor

Re: Unable to run xclock from oracle

Hi nilesh,

Try this now!!

Login using root and go to ssh_config under opt/ssh/etc/ssh_config

check if you see

ForwardX11Trusted yes

If you find it "no" then set it to "yes"

Also

ForwardX11 yes

Regds....Deepak


"There is always some scope for improvement"
Nilesh Naik
Advisor

Re: Unable to run xclock from oracle

I tryed Xmanager tools and it works thanks.
Oviwan
Honored Contributor

Re: Unable to run xclock from oracle

so if the answers were helpful don't forget to say thanks with hp points.
Deepak Kr
Respected Contributor

Re: Unable to run xclock from oracle

Good to hear that now you are able to get it work.

Cheers!!
"There is always some scope for improvement"
OldSchool
Honored Contributor

Re: Unable to run xclock from oracle

Nilesh said:"Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match
Error: Can't open display: localhost:10.0"

that's the error noted in previous posts along with the fix for it. it indicates that oracle *wasn't*" properly authorized to use the display. As xclock worked before the su, the display variable is fine. Properly fixing the xauth file would / should resolve the problem.