X11 display over ssh with monitor connected to remote machine

Posted by Sumit on Super User See other posts from Super User or by Sumit
Published on 2012-11-06T16:34:25Z Indexed on 2012/11/06 17:06 UTC
Read the original article Hit count: 313

Filed under:
|

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)?

© Super User or respective owner

Related posts about ssh

Related posts about x11-forwarding

  • How to use X11 forwarding with putty

    as seen on Super User - Search for 'Super User'
    I have a VM with RHEL 5 without an X server. My host has Windows 7. I need to connect to the VM and redirect the X11 output of the commands to my host. I know that if my host were a GNU/Linux machine it would be as easy as ssh -X . I'm ussing PuTTy to connect by SSH to the VM, I tried enabling… >>> More

  • fast X11 forwarding

    as seen on Super User - Search for 'Super User'
    Hi, I am using ssh -X to display GUI apps locally. Is there a better way to speedup this processes - something similar what NoMachine Nx server / client does? Thanks, Mariusz. >>> More

  • failed to enable x11 forwarding

    as seen on Super User - Search for 'Super User'
    I am trying to enable X11 forwarding on my server which is running on FreeBSD 7.1. I have a putty installed in my windows in which i have enabled X11 forwarding by checking on Enable X11 forwarding and specifying following parameter X display location localhost:0 after that i run… >>> More

  • failed to enable x11 forwarding

    as seen on Super User - Search for 'Super User'
    I am trying to enable X11 forwarding on my server which is running on FreeBSD 7.1. I have a putty installed in my windows in which i have enabled X11 forwarding by checking on Enable X11 forwarding and specifying following parameter X display location localhost:0 after that i run… >>> More

  • ssh xauth error Mac OS 10.6.3

    as seen on Super User - Search for 'Super User'
    Whenever I ssh with X11 forwarding to a remote box from my macbook I get the following error after a few seconds pause: Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. Any ideas on how to fix… >>> More