LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   xclock not opening in rehat linux 64-bit (https://www.linuxquestions.org/questions/linux-newbie-8/xclock-not-opening-in-rehat-linux-64-bit-923572/)

subani123 01-13-2012 04:49 AM

xclock not opening in rehat linux 64-bit
 
Hi All,

I am very new to linux environment learning basics in redhat linux
I tried to open xclock utility in redhat
its givivng me the error:
Cant Open DISPLAY for linux:0.0

I tried this:
$xhost +linux

$export DISPLAY=linux:0.0
$xclock
Cant Open DISPLAY for linux:0.0

I logged in as root user

clock is not opening,please help me how to resolve this issue..

subani123 01-13-2012 04:51 AM

sorry not to mention this:
linux is my hostname
$xhost +linux------>linux has been added to access list
I treid the Env. variable setting with IP Address also but no luck.
please help

deep27ak 01-13-2012 04:58 AM

Quote:

Originally Posted by subani123 (Post 4573483)
I tried this:
$xhost +linux

you need to try this command as root
Code:

#xhost local:linux
is linux hostname of your machine?
is it mentioned in your hosts file?

try this commnd
Code:

#export DISPLAY=localhost:0.0
Code:

#xclock

subani123 01-13-2012 05:07 AM

HI deepak,

I will try it and get back to you ,Thanks

deep27ak 01-13-2012 05:16 AM

update
 
In one of my test nodes this is the command which works

Code:

#xhost local:linux
Code:

$export DISPLAY=:0

$xclock


subani123 01-13-2012 08:31 AM

I tried this #xhost local:linux as root user..

giving me an error
xhost: unknown address family "localhost"
xhost: bad hostname "localhost:linux"


If I open a terminal as root and enter xclock its opening correctly
but when i login as oracle user,set the DISPLAY Env variable and tried then Cant Open DISPLAY for linux:0.0

I followed this:
#xhost +linux

#su - oracle
$export DISPLAY=linux:0.0;
$xclock

error:Cant Open DISLPAY..

i dont know what i am missing here..

deep27ak 01-16-2012 01:40 AM

what is the output you get as root user with this command
Code:

#echo $DISPLAY
use the same value to export as oracle user
Code:

$export DISPLAY=(output of above)
make sure you have your /etc/hosts file properly configured with the entries of hostname and localhost

as in my machine when I try (RHEL 5)
Code:

#xhost +deepak
xhost: bad hostname "deepak"


TB0ne 01-16-2012 11:01 AM

Quote:

Originally Posted by deep27ak (Post 4575628)
what is the output you get as root user with this command
Code:

#echo $DISPLAY
use the same value to export as oracle user
Code:

$export DISPLAY=(output of above)
make sure you have your /etc/hosts file properly configured with the entries of hostname and localhost as in my machine when I try (RHEL 5)
Code:

#xhost +deepakxhost: bad hostname "deepak"

...and all of this will only work, if the local workstation (where you're trying to get the window to come up), is set up to allow incoming X connections. Most Linux distros these days ship with it disabled for security purposes, so running "xhost +" won't work...this question has also been asked (and answered) on this site MANY times...do a quick search for it.

OP, you don't tell us what version/distro of Linux you're using, so it's hard to give you a specific way to do this. First thing to do is a "ps -ef | grep nolisten". If you find something, chances are it's your X server, and the "-nolisten" tells you it's not accepting incoming connections. Go into your systems administrator software, and enable it...again, we don't know what version/distro, so we can't say how. In openSUSE, it's YAST.

Once it's enabled, you have to reboot...after it's back up, look for the "-nolisten" again, and you shouldn't see it. THEN, as root, do "xhost <ip address of remote system>". That will allow the system you're running xclock FROM, access to the local X server. Then, log into the remote system, and run whatever you want.

deep27ak 01-16-2012 11:37 PM

Quote:

Originally Posted by TB0ne (Post 4575968)
...and all of this will only work, if the local workstation (where you're trying to get the window to come up), is set up to allow incoming X connections. Most Linux distros these days ship with it disabled for security purposes, so running "xhost +" won't work...this question has also been asked (and answered) on this site MANY times...do a quick search for it.

OP, you don't tell us what version/distro of Linux you're using, so it's hard to give you a specific way to do this. First thing to do is a "ps -ef | grep nolisten". If you find something, chances are it's your X server, and the "-nolisten" tells you it's not accepting incoming connections. Go into your systems administrator software, and enable it...again, we don't know what version/distro, so we can't say how. In openSUSE, it's YAST.

Once it's enabled, you have to reboot...after it's back up, look for the "-nolisten" again, and you shouldn't see it. THEN, as root, do "xhost <ip address of remote system>". That will allow the system you're running xclock FROM, access to the local X server. Then, log into the remote system, and run whatever you want.

With all due respect sir,

The OP says subani123 is able to connect as root but unable as user?
Even I checked few blogs and websites on the same, on the conclusion of which I had replied with my solution.

and the error says
Cant Open DISPLAY for linux:0.0
so I believe it is syntax error but I will still look forward for the solution to gain something new.

Thanks for your notification.

TB0ne 01-17-2012 09:13 AM

Quote:

Originally Posted by deep27ak (Post 4576478)
With all due respect sir,
The OP says subani123 is able to connect as root but unable as user? Even I checked few blogs and websites on the same, on the conclusion of which I had replied with my solution.

and the error says
Cant Open DISPLAY for linux:0.0
so I believe it is syntax error but I will still look forward for the solution to gain something new.

Quite true. But, if the OP doesn't run the xhost command (either "xhost +" or "xhost <ip address of remote system>" as root, they won't be able to allow incoming connections, even if they do export the DISPLAY variable, which may explain why it works as root, but not as oracle.


All times are GMT -5. The time now is 02:51 PM.