LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 06: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, 07:01 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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, 07: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, 07: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, 07: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 07:59 AM.
 
Old 09-25-2008, 08:13 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you've not run xhost properly. please read my post again more carefully.
 
Old 09-25-2008, 08: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, 09: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 09:22 AM.
 
Old 09-25-2008, 09:52 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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, 01: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:22 AM.

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
Open Source Consulting | Domain Registration