Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with export DISPLAY

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to export DISPLAY to my workstation, but i cant. i keep getting DISPLAY=hostname is not an identifier any suggestions would be greatly appreciated
 
What shell are you using? In ksh it's export DISPLAY='hostname'(or IP):0.0 or in csh setenv DISPLAY 'hostname'(or IP):0.0. Make sure you put the :0.0.
 
thanks for the response...it's ksh...i am typing :0.0 after the hostname
 
I think you will find that
"DISPLAY=hostname: is not an identifier"
is the bourne shell response to the command
"export DISPLAY=hostname"

Try typing "ksh -o vi" then repeat the command, or alternatively in sh you should type
"DSIPLAY=hostname"
"export DISPLAY"
 
thanks ged, but that doesn't seem to work either, i am getting
 
not sure if all of my response was posted..."error:cant open display:hostname"...this is what i am trying ot do...telnet into a server which has solstice loaded on it and bring it up on my workstation...hope this helps
 
Did you try "xhost +" from the workstation?, or does that not apply here?
 
yes i did...that doesnt work either...actually i put xhost + in my .profile....
 
What sort of machine is your workstation? If it's a Windows PC, then you will need to an X server running under Windows before you can get anywhere.
 
Whether you use sh, ksh, or bash, the following will always work, where x.x.x.x is the IP address of the X capable workstation you are logging in from:
[tt]
DISPLAY=x.x.x.x:0.0
export DISPLAY
solstice
[/tt]
I use this quite often (in fact, I set up a shell function in my .profile to do this) to get Solstice running in a window on my PC.

If you use csh, tcsh, or another variant of the C-shell, the following will work:
[tt]
setenv DISPLAY x.x.x.x:0.0
solstice
[/tt]
The [tt]xhost[/tt] command should be run on the workstation you are running X on. (Assuming it's a Unix workstation of course.) Using xhost you are telling your local X server that programs from the specified IP address are allowed to run on your local X server. xhost was created to stop people running things like xearth, xsnow, and xeyes on other user's workstations. Oh, how we used to laugh when the 100th pair of eyeballs popped up on our X session ;-)

Anyway, you will need to run xhost on your local workstation specifying the IP address or name of each remote server that you will be running a X program on:
[tt]
# Let remote.server.one and remote.server.two run X programs
# on my workstation.
xhost remote.server.one
xhost remote.server.two
[/tt]
Why not just use the "+" to let anyone connect? Because it's a bad habit to get in to if you ever use it on an Internet connected server...

Hope this helps.
 
Interesting Andy, I will log this info for future reference if you do not mind.

I normaly use a PC running NT4.0 and my current site uses "HummingBird Exceed" to get X terminal emulation.
 
Andy,

Thanks for the info, it was of tremendous help [sig][/sig]
 
How can you modify the Access control through xhost on a serial terminal ? If the server doesn't have a display card.
 
Okay so I got another question along the same vien.
I have three unix boxes one in cali one in new york and one in Amsterdam

The box in new york can see both cali and amsterdam however amsterdam cannot see cali.

I wann be able to export my display from amsterdam to cali is there a way to define :1 as another ip or something??

so I would dosomething like export DISPLAY=Newyork:1
and newyork would know to forward that to display=Cali:0

any help would be awesome

MauiLion [sig][/sig]
 
Two questions here, further down, after the background:

I manage webservers on Sun, Solaris 2.6. I've never had to configure the .cshrc or .login for "users" outside of myself, and I use vi.

There are a couple of webdesigners who need to be able to su to root, but when they do that, they can't use the filemanager or the dtpad at the bottom of the CDE screen. I'm not worried about them using root -- they're scared to use it and have very few things they'll do before they exit out of it.

It's a regular 2.6 install, which of course includes CDE, and is fully patched, nothing really special.

They use tcsh, which reads the .cshrc in their home directory.

The current .cshrc contains these, that might make a difference:
setenv PATH /usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/GCC281/bin
setenv MOZILLA_HOME /usr/local/netscape
setenv LD_LIBRARY_PATH /usr/local/lib:/usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/ucblib
umask 037
#
I change the display, and I've changed the editor, and I've tried xhost and I've tried Solstice!

1. setenv DISPLAY hostname:0.0 (works, same result with IP)
set EDITOR /usr/dt/bin/dtpad (works)

Try launching editor:
/usr/dt/bin/dtpad (error: Xlib: connection to "hostname:0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Error: Can't open display: hostname:0.0

Try doing the xhost command:
/usropenwin/bin/xhost +hostname (error: same Xlib error as above)


Try the Solstice:
solstice (error: same Xlib error as above)

What am I missing here??? It's gotta be something simple because I can't find it documented anywhere -- but I've never had to configure servers for users to use.....

2. What command does the user use to launch filmanager or the dtpad once they have su'd to root??

THANKS!!!! :)
 
you could try the old fashioned :
DISPLAY=xxx:0.0; export DISPLAY
 
MauiLion:

There is no reason Amsterdam should not be able to see Cali if it can see New York. Is Cali in Amsterdam's dns or host file?

Are you saying that Cali and Amsterdam cannot talk to each other? If this is the case for what ever reason, then login to Amsterdam from Cali through New York - open a telnet or rsh/rlogin to Amsterdam once you are logged in to New York. Then set your DISPLAY to your Cali display. This assumes that you can see New York from Cali.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top