LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 09-25-2008, 07:56 AM   #1
Junior_DBA
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Rep: Reputation: 15
Smile DISPLAY problem


Hi all. I am in trouble I am trying to run java application. I set DISPLAY=localhost:0.0 but without success
Quote:
Inizializing java virtual machine...
Can't connect to x11 window server using localhost:0.0
I am on VMware 6.0 / RHEL4(32) /Windows XP
 
Old 09-25-2008, 08:01 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
stabbing in the dark, you're running this as root whilst logged in to X as a normal user? run "xhost +localhost" as your non-root account to let root use the X display.
 
Old 09-25-2008, 08:22 AM   #3
Junior_DBA
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks for responce. But I am newbie, don't know how to use xhosts

I logged in as root. Applications->Terminal.

root@newbie_world > su - mega_newbie
mega_newbie@newbie_world> xhost
Xlib: connection to ":0.0" refused by server
Xlib: no protocol specified
unable to open display
 
Old 09-25-2008, 08:48 AM   #4
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
$ export DISPLAY=:0.0
$ xhost +

The above works on my ubuntu machine --
You coould also do:
$ export DISPLAY=localhost:0.0
$ xhost +

if you do:
$ echo $DISPLAY -- you can see what the display is currently set to

I think in some distros, you would do:
$ setenv DISPLAY=:0.0
or
$ setnv DISPLAY=localhost:0.0
 
Old 09-25-2008, 08:57 AM   #5
Junior_DBA
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Original Poster
Rep: Reputation: 15
I am getting the same error

export DISPLAY=:0.0
echo $DISPLAY
:0.0
./java_application
Inizializing java virtual machine...
Xlib: connection to ":0.0" refused by server
Xlib: no protocol specified
unable to open display


localhost:0.0 also throws this error

Last edited by Junior_DBA; 09-25-2008 at 08:59 AM.
 
Old 09-25-2008, 09:13 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you've not run xhost properly. please read my post again more carefully.
 
Old 09-25-2008, 09:22 AM   #7
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
That sounds like you are working across the LAN where you are sshed into machine B from Machine B
if so, then you need to do:
Machine B where ip address is 192.168.1.102
$ export DISPLAY=:0.0
$ xhost +

then on machine A where ip address is 192.168.1.101
$ export DISPLAY=:0.0
$ xhost +

then again on Machine A
$ ssh 192.168.1.102
password XXXXX
export DISPLAY=192.168.1.101:0.0
$ xhost
 
Old 09-25-2008, 10:16 AM   #8
Junior_DBA
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Original Poster
Rep: Reputation: 15
No I am working on WMware 6.0 i run it on the same virtual machine.

Acid, i didn't get what you suggested. I need to run it from non-root user mega_newbie.

i did:
root@newbie_world >xhost + localhost
xhost: enable to open DISPLAY "localhost:0.0"

Last edited by Junior_DBA; 09-25-2008 at 10:22 AM.
 
Old 09-25-2008, 10:52 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Quote:
root@newbie_world >xhost + localhost
xhost: enable to open DISPLAY "localhost:0.0"
... as you are root, like i told you not to be. don't do this as root.
 
Old 09-26-2008, 02:21 AM   #10
Junior_DBA
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Original Poster
Rep: Reputation: 15
mega_newbie@newbie_world > xhost + localhost
xhost: unable to open display "localhost:0.0"

 
  


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
Display Problem jp_ Slackware 1 01-01-2006 01:28 AM
display problem syedabdul Linux - Hardware 1 12-06-2005 09:04 PM
Problem withChanging DISPLAY environment variable to display on someone else's screen wantsri Linux - Networking 1 10-25-2005 12:14 PM
Display problem binumvk Linux - Hardware 3 03-02-2004 04:56 AM
RH9 Shrike /sbin/loader display problem with SIS 630 laptop - display is blank ! johnvoisey Red Hat 4 11-01-2003 07:52 AM


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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration