Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At present we're trying to write a program which uses mpirun to launch multiple X11 clients. If the programs are text-only, then using the following command, we can run proceses on a list of computers:

mpirun -np 4 --hostfile hostlist date

Here hostlist is a file of mpi-configured computers. The computers are set up to authenticate automatically using public keys. We can also run X11 programs on the local computer only, for instance:

mpirun -np 4 xclock

shows four xclocks as expected. However, if we try to run X11 programs using a hostfile:

mpirun -np 4 --hostfile hostlist xclock

then two xclocks launch but the remote computer reports:

Error: can't open display:

However, we have configured .ssh/config with

ForwardX11 Yes

And we can verify that the following command sequence works:

# connect to mpi cluster node
# xclock appears on screen

Furthermore, if we set a DISPLAY variable with mpirun's -x as follows:

mpirun -np 4 --hostfile hostlist -x DISPLAY= xclock    

Then we get another error:

Error: can't open display:

We tried to disable any access control with:

xhost +

To summarize, we'd like some help with mpirun and X11 Forwarding. We're running on Ubuntu 12.10 and openmpi 1.4.5.

share|improve this question
up vote 1 down vote accepted

Following command seems to work well

mpirun -d -np 4 -hostfile hostlist -mca pls_rsh_agent "ssh -X -n" xclock
share|improve this answer
So the combination of enabling debugging and setting the pls_rsh_agent variable are required. – speciousfool Jan 25 '13 at 11:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.