Welcome to Part 4 of Linux Remote Desktop Series. I highly recommend that you see the basic assumptions and background before you read this any further.

What we will learn: In our last part we saw how to connect to a remote Linux host which has XDMCP protocol enabled through a Windows XP machine. In this part we will learn how to connect to your remote Linux host from another Linux machine.

Follow the Steps 1 and Step 2 from the here and then continue reading further.

Log in as root on your Linux machine and give the following command:

# X :1 -query <ip-address-of-remote-linux-host>

Example:

# X :1 -query 192.168.0.1

and you should be able to see the remote login screen (GDM, KDM, etc.) of your remote Linux host. Now you can log in as if you were physically present on that machine.

Additional Notes and some background

Suppose you gave the above command from regular Linux Graphical environment like GNOME. The good thing is that you can switch back to your GNOME environment from which you gave the above command by pressing “Ctrl-Alt-F7″ and you can again swithc back to your remote Linux host session by pressing “Ctrl-Alt-F8″.

Basically when you gave the above command, your X server started the remote login session on tty8 without killing your GNOME session which runs on tty7.

Note that you could not have given the following command from your GNOME session:

# X :0 -query 192.168.0.1

Simply because your current X/GNOME session on your local machine is alreay running on Display “0” and you are likely to get the following error message:

Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock and start again.

Now suppose you login just on your console (tty1) on your local Linux machine without running any X server, then it will be possible to run the remote session on Display “0” by giving this command:

# X :0 -query 192.168.0.1

Now in this case your remote session will run on tty7 instead of tty8, Why? Because when you gave the above command there was no X server already running unlike when you give the command from a GNOME or any other Graphical environment session.

In general your X server starts display in the following order:

Display 0 on tty7
Display 1 on tty8
Display 2 on tty9
....... and so on.

Happy XDMCP’ing!

Part 5: Review and Conclusion

Be Sociable, Share!