LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-13-2012, 04:49 AM   #1
subani123
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Rep: Reputation: Disabled
Question 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..
 
Old 01-13-2012, 04:51 AM   #2
subani123
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
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
 
Old 01-13-2012, 04:58 AM   #3
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

Rep: Reputation: 219Reputation: 219Reputation: 219
Quote:
Originally Posted by subani123 View Post
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

Last edited by deep27ak; 01-13-2012 at 05:06 AM.
 
Old 01-13-2012, 05:07 AM   #4
subani123
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
HI deepak,

I will try it and get back to you ,Thanks
 
Old 01-13-2012, 05:16 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

Rep: Reputation: 219Reputation: 219Reputation: 219
update

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

Code:
#xhost local:linux
Code:
$export DISPLAY=:0

$xclock
 
Old 01-13-2012, 08:31 AM   #6
subani123
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
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..
 
Old 01-16-2012, 01:40 AM   #7
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

Rep: Reputation: 219Reputation: 219Reputation: 219
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"
 
Old 01-16-2012, 11:01 AM   #8
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,241

Rep: Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475
Quote:
Originally Posted by deep27ak View Post
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.
 
Old 01-16-2012, 11:37 PM   #9
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

Rep: Reputation: 219Reputation: 219Reputation: 219
Quote:
Originally Posted by TB0ne View Post
...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.
 
Old 01-17-2012, 09:13 AM   #10
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,241

Rep: Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475Reputation: 2475
Quote:
Originally Posted by deep27ak View Post
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.

Last edited by TB0ne; 01-17-2012 at 09:35 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Long file names on Linux file server jumbled when opening on 16-bit PC program. brandonhughesj General 3 03-04-2009 07:53 AM
rehat linux enterprise 2.1 dramous Linux - Newbie 5 10-05-2004 02:43 PM
Help me: setting up telnet service in rehat linux 7.1 tejpatil Linux - Newbie 0 02-09-2004 07:50 PM
Cannot boot with rehat linux 9 satusred Linux - Newbie 2 11-03-2003 04:21 PM


All times are GMT -5. The time now is 10:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration