X11 display over ssh with monitor connected to remote machine
- by Sumit
I have the following setup: Machine A (a.corp, 192.168.100.130, local machine) and Machine B (b.corp, remote machine) and a monitor is connected to each of these machines. When I ssh from a.corp to b.corp as
$ ssh -X b.corp
$ xclock
Error: Can't open display:
I tried setting the DISPLAY variable as
$ ssh -X b.corp
$ export DISPLAY=`echo $SSH_CLIENT|cut -f1 -d\ `:0.0
$ echo $DISPLAY
192.168.100.130:0.0
$ xclock
xclock's display opens up but on the monitor connected to b.corp (remote machine) and not on the monitor connected to a.corp (local machine). Is there a way to force the display to appear on the monitor of the local machine (a.corp)?