Staring X applications through an ssh tunnel

If you encounter the problem of being unable to start an X application through an ssh-tunnel and run into an error message similar to

Can't open display

or

RuntimeError: could not open display

you should check

  • that you used ssh -X[...] to enable X11 forwarding when connecting to the server
  • that the xauth-package is installed correctly on your server

xauth is used to edit and display the authorization information used in connecting to an X server.

For example, after installing a minimalistic CentOS the xorg-x11-xauth package is not necessarily installed as well.

The solution is quite simple:

yum install xorg-x11-xauth

does the trick! You may have to reconnect to give xauth the opportunity to create a new authority file for you user (~/.Xauthority)

Leave a Reply

Your email address will not be published.