title: Failed to open display error
body: <p>I am having an error whenever I try to open an external display through sshing into a linux server. The error occurs in various contexts:</p>
  
  <p>freeglut (./executable): failed to open display 'localhost:22.0' <em>*</em> Program linking with openGL</p>
  
  <p>(gedit:9741): Gtk-WARNING **: cannot open display: localhost:22.0</p>
  
  <p>Essentially anything that requires opening an external display results in the error. From searching on the internet, it has something to do with the display variable and it was originally just 0:0. However, I changed my local ~/.profile to include the line (DISPLAY=localhost:0.0; export DISPLAY) it showed the same error, but with localhost:x:0 rather than just 0:0.</p>
  
  <p>I have xquartz installed, and I'm sshing with -Y flag set. I've tried the -X flag as well and still luckless. </p>