Skip to content
Run GUI programs over SSH without an X server

Run GUI programs over SSH without an X server

There are several methods; here are a few of them.

  1. SSH X forwarding.
    • Make sure these parameters are enabled in /etc/ssh/sshd_config on the server:

      # Specifies whether TCP forwarding is permitted
      AllowTcpForwarding yes
      X11Forwarding yes
      # The first display number available for sshd's X11 forwarding
      X11DisplayOffset 10
      # Bind the X11 forwarding server to the loopback address (yes) or to the wildcard address (no)
      X11UseLocalhost yes
    • Turn on X forwarding when connecting: ssh -X user@host

    • If you get errors with -X, treat the remote machine as a trusted client: ssh -Y user@host

  2. Use the remote display. Run the program with -display :0.0 after its name. Running it inside screen is handy here.
  3. Export the display variable: export DISPLAY=":0.0", then start the program.
Last updated on