Hello,
I'd like to open a bunch of windows on a server/servers from a script using ssh. The point is to run a tool several times (often a quite high number of times) with different parameters, but I'm substituting xeyes for that tool below. I have keys set up to log on transparently onto the server, so I tried:
#!/bin/bash
for run in `seq 1 10`
do
ssh -X -l <my user> <server> "xeyes" &
done
However, whenever I run this, I only get a subset of instances of xeyes, anywhere between 1 and (never quite) 10. For all the missing windows, I get an error message:
Error: Can't open display: localhost:18.0
Error: Can't open display: localhost:20.0
Error: Can't open display: localhost:22.0
Error: Can't open display: localhost:23.0
Therre also seems to be issues with authentication but I don't understand what exactly because I also get a bunch of
/usr/bin/X11/xauth: error in locking authority file /home/<user>/.Xauthority
X11 connection rejected because of wrong authentication.
Although I've tried to read up, I don't quite understand what .Xauthority is supposed to do, but I removed (well, renamed .Xauthority.bak) the file in question on the server and tried again, but the errors still occur.
Can someone explain/help/point me to better documentation than I found?
I must admit that I feel like looking for a needle in a haystack when I google the problem because I come up with tons of pages explaining how to set your DISPLAY variable and such, but that doesn't seem to be the problem here, since 1) "ssh -X" should take care of that for me 2) some of the windows are opening.
Again, using X over ssh in general works, just not when I try to start many windows on the server from within a loop. Starting them all by hand with repeated
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
$ ssh -X -l <user> <server> "xeyes" &
works fine.
In case this is relevant, I am using Xquartz 2.6.1 on a Mac to connect to a Linux (Ubuntu) box.
