Search code examples
linuxx11xserverx11-forwarding

How to export DISPLAY onto another linux host's Xserver


I use Xming for running Xserver on windows machine and that works just fine.

export DISPLAY=<windows_host_IPAddr>:0.0

But I want to export display onto another linux host.

export DISPLAY=<linux_host_IPAddr>:0.0

I am running opensuse and I think Xorg should do the job. But I could not figure out what exactly needs to be done.

If there are any other Xming equivalent packages for linux, please let me know. Thanks in advance.


Solution

  • The only thing you have to do is to enable remote X sessions on your SuSe box. So, login at the desktop, open a shell, and type:

    xhost +<IP_address_of_server>
    

    Where IP_address_of_server is the address of the machine where you are starting your actual program (so you allow incoming X connections).

    However, this is not very secure, so a better option may be to use SSH and X-forwarding. Again, on your SuSe box, open a terminal and type

    ssh -X <account>@<IP_address_of_server>
    

    Then, in the ssh session start your X program without any DISPLAY options, and the output should appear on your local desktop.

    In case you have trouble with the -X option, you may try the -Y one, but see the manual page of ssh for details.