Export X Display

From Initq

Jump to: navigation, search

The issue

If we have two machines, both running some variant of *nix and we would like to run some X apps on one machine but show up on machine two, how would we do it.

Well, let's start with naming our machine. we will call one machine source and second machine destination.

Machines
Source Destination
192.168.1.2 192.168.1.16

We would like to export display from source to destination. When ever you want to export any X apps you need to make sure that the destination is running a X server. The destination machine could be a windows box or any type of *nix, as long as it is running a X server it will render the X application that you have executed on the source box.

Step 1

start X on the destination box with startx or your desktop manager such as kdm, xdm or gdm.

Make sure on your destination box you have "ForwardX11 yes" in your /etc/ssh/ssh_config file.

Step 2

Allow client systems to connect by using the xhost + command. some examples are:

$xhost +
$xhost +192.168.1.2
Step 3

Now you can ssh to your source box and install xauth then try xclock or xterm. If it does not work then do the following.

export DISPLAY=:0.0
export DISPLAY=host_or_ip:0.0
Personal tools