LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-05-2011, 02:52 PM   #1
laredotornado
Member
 
Registered: Apr 2011
Posts: 71

Rep: Reputation: 0
How can I figure out the right value for the DISPLAY variable?


Hi,

Here is my Linux version ...

Code:
Linux qa1234c 2.6.18-194.8.1.el5 #1 SMP Wed Jun 23 10:52:51 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
We are trying to run some google web toolkit integration tests, but the ones that rely on a display die with the error ...

Code:
Caused by: java.lang.Exception: java.lang.InternalError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
	at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
	at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:169)
	at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
	at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1135)
	at com.google.gwt.resources.rg.ImageBundleBuilder.toPng(ImageBundleBuilder.java:538)
	at com.google.gwt.resources.rg.ImageResourceGenerator.reencodeToTempFile(ImageResourceGenerator.java:641)
	at com.google.gwt.resources.rg.ImageResourceGenerator.prepare(ImageResourceGenerator.java:567)
	at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.initAndPrepare(AbstractClientBundleGenerator.java:1043)
	at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.initAndPrepare(AbstractClientBundleGenerator.java:1069)
	at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.generateIncrementally(AbstractClientBundleGenerator.java:412)
	at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647)
	at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
	at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
	at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268)
	at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141)
	at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585)
	at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455)
	at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
	... 43 more
I have tried setting my DISPLAY variable to ":0", ":10.0", and "localhost:10.0" but all failed. I have Xvfb installed. How can I figure out the proper values for the DISPLAY variable, or at least a strategy for attacking this error? Thanks - Dave
 
Old 12-05-2011, 03:29 PM   #2
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
try typing:
Code:
 xhost +
This should allow - DISPLAY variable to work - I'd set DISPLAY=10.0

What xhost+ does is it grants access to everyone trying to access X server. If you want to limit it to localhost do a:

Code:
 xhost + localhost
 
Old 12-05-2011, 03:43 PM   #3
laredotornado
Member
 
Registered: Apr 2011
Posts: 71

Original Poster
Rep: Reputation: 0
I tried this on a command line, but didn't get very far ...

Code:
ccqavob02c:/home/e18538 $ export DISPLAY=10.0
ccqavob02c:/home/e18538 $ xhost +
xhost:  unable to open display "10.0"
Further thoughts? - Dave
 
Old 12-05-2011, 04:16 PM   #4
kubuntu-man
Member
 
Registered: Oct 2011
Posts: 36

Rep: Reputation: Disabled
Most times, DISPLAY is
Code:
:0.0
or
Code:
localhost:0.0
As kbscores mentioned, you need to allow the connection via xhost.
There are different versions for the syntax. On my system, it is
Code:
xhost +
for ALL or
Code:
xhost +local:
for local clients.

For all of these versions, you need the x server to be up and running. I'm not sure if xvfb is sufficient.
 
Old 12-05-2011, 05:19 PM   #5
EmaRsk
Member
 
Registered: Mar 2006
Distribution: Funtoo
Posts: 124

Rep: Reputation: 26
Why "10.0"? The current one is usually ":0.0". Maybe ":10.0"? It's still weird, though.
Maybe you should check the google web toolkit docs and try to figure this out.
Maybe you need to open a xnest or a xephyr on DISPLAY :10.0 .
 
Old 12-06-2011, 09:03 AM   #6
laredotornado
Member
 
Registered: Apr 2011
Posts: 71

Original Poster
Rep: Reputation: 0
I think I'm missing what "xhost" is supposed to do. My question is how do I figure out what the valid values of DISPLAY should be? I'm still getting these errors ...

Code:
[e18538@qa3398c ~]$ export DISPLAY="localhost:0.0"
[e18538@qa3398c ~]$ xhost +
xhost:  unable to open display "localhost:0.0"
[e18538@qa3398c ~]$ xhost +local
xhost:  unable to open display "localhost:0.0"
or if using DISPLAY=:0.0 ...

Code:
[e18538@qa3398c ~]$ export DISPLAY=":0.0"
[e18538@qa3398c ~]$ xhost +
xhost:  unable to open display ":0.0"
[e18538@qa3398c ~]$ xhost +local
xhost:  unable to open display ":0.0"
Thanks - Dave
 
Old 12-07-2011, 10:34 AM   #7
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
It most likely depends on where you want to display. For instance -- you have a server and a client --

On server use:
Code:
xhost +
On client:
Code:
export DISPLAY=ServerIP:0.0
./xprogram

The above code will run xprogram from client on display 1 of server.

So Same concept for doing this locally - Instead of there being two machines just do both steps on a single machine.
Code:
xhost + 
export DISPLAY=localhost:0.0
./xprogram
Also - Lets say you were using a sunray - which typically has several Displays - echo $DISPLAY of terminal to diplay xprogram and instead of 0.0 you would want to use whatever echo $DISPLAY output.

Last edited by kbscores; 12-07-2011 at 10:41 AM. Reason: missing stuff
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Display variable nagavinodh Linux - Newbie 1 09-11-2009 09:43 AM
Problem withChanging DISPLAY environment variable to display on someone else's screen wantsri Linux - Networking 1 10-25-2005 12:14 PM
Tcl Error no display name and no DISPLAY environment variable thinkgeek Programming 5 07-06-2005 11:24 PM
Can't figure out DISPLAY and GUI apps from remote console. bkeating Linux - Newbie 1 04-29-2004 03:18 PM
I want to figure out which display a process is running on drgowans Linux - Software 4 11-10-2003 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:01 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