1829103 Members
2227 Online
109986 Solutions
New Discussion

remote execution

 
SOLVED
Go to solution
Francois Bariselle_3
Regular Advisor

remote execution

I want execute a program on a remote host but my shell return this message:

Error: Can't open display:

It's normal !

I say that is possible, how...

Thank in advance.
Fais la ...
3 REPLIES 3
Helen French
Honored Contributor
Solution

Re: remote execution

hey,

U can use 'remsh' for doing this. Check whether 'rexecd' is running on the server ?

See man pages of rexecd, rexec and remsh

HTH,
Shiju
Life is a promise, fulfill it!

Re: remote execution

It seems like you are trying to run graphic program.
Do something like this:
xhost + localbox
and then
remsh remotebox? /usr/bin/X11/xclock -display localbox:0.0
Bill Hassell
Honored Contributor

Re: remote execution

If you are running Xwindows (which is not 'normal' Unix) then the remote program expects to have either -display set on the command line or the DISPLAY variable set in the remote environment prior to execution of the command. This is to tell the program where to put the image.

This is not automatic although with caveats, you could have the remote host figure out your DISPLAY value automatically. Suppose you want to run xclock remotely and display the result on your screen. Assuming you are using telnet to the remote system, you can put this into your .profile:

export DISPLAY="$(who -muR | awk '{print $NF}'):0.0"

Now the DISLAY variable will be set automatically when you login. NOTE: remsh does not perform a normal login so you would have to run the command locally. So instead of:

$ remsh remoteCPU /usr/bin/X11/xclock

you would have to do something like:

$ remsh remoteCPU /usr/bin/X11/xclock -display "$(hostname):0.0"

or you could make it simpler by keeing the DISPLAY variable set in your local environment with something like:

export DISPLAY="$(hostname):0.0"

These examples assume that you are running an HP-UX workstation and not a PC. For the PC solution, your remote command would have to somehow obtain the hostname or IP address of the PC and include it on the command line, usually by using the -display option in the program.


Bill Hassell, sysadmin