X Windows: Remote X to Linux

From SlackWiki
Revision as of 12:59, 30 August 2012 by Arfon (talk | contribs) (ADDED: X11 over SSH)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NOTE: In the X11 world, the SERVER machine is the one listening for a connection (the local machine (your desktop)).
NOTE: The CLIENT machine is the one initiating the connection (the remote machine).
I know, it sounds backwards but, it is actually correct if you understand the X11 connection.

Plain Ol' Vanilla X11 Remote Connection

1) Tell your X11 server machine (your desktop) to accept X11 connections from the client machine.

  • If it's a one time connection, just run the following from the command line


  • You can add the following to .bashrc or .profile to make it permanent
    xhost +X11_SERVER_IP  (the remote machine)
    EXAMPLE: xhost +

2) Start the connection from the Client Linux machine (the remote machine)- Connect to the remote Linux machine via ssh/telnet/rlogin/whatever and run:

     EXAMPLE: DISPLAY=;export DISPLAY;xterm &
     REMEMBER: The X11 server is your desktop.

Remote X11 Over SSH

1) ensure that X11Forwarding is enabled in /etc/ssh/sshd_conf on the remote machine.

2) ensure that X11Forwarding is enabled in /etc/ssh/ssh_conf on the local machine.

3) open an X11 forwarded ssh session from the local machine to the remote machine (opposite of what you do for a 'vanilla' remote X connection):

    ssh -X joe@
    xterm &

PROBLEM: ssh connection is complaining about an “Invalid MIT-MAGIC-COOKIE”.
FIX: start a less secure ssh session: