Question: I am trying to run `gedit` from an SSH terminal on Windows, connected to an Amazon EC2 instance running Ubuntu 12.04 Server and I am getting this error:

```
Cannot open display:

```

How do I fix it?

Answer: 
Since you are using Windows on your side, you will need an SSH-client that runs a local X server on Windows to run graphical applications from the server remotely on your screen. 

From experience, I would recommend the free [MobaXTerm](http://mobaxterm.mobatek.net/) which has this functionality built-in. Please download it and give it a try:

![enter image description here](https://i.stack.imgur.com/r0NuO.png)

If you get any errors, that's because sometimes a minimal server image may not be set up to *allow* X-forwarding into it. In that case, please comment and I'll help you solve it; I've done this with lots of minimal VPSs running Ubuntu/Debian.
Well, I had this issue of being unable to use X forward on my vagrant instance. Solution for that was pretty straight forward. Simply install the `xauth` package. If it still doesn't works then the solution is to enable X11Forwarding and related settings in the respective `/etc/ssh/ssh_config` and /etc/ssh/sshd\_config`
These are the only issues that usually need fixing in terms of X forwarding.

Also, one of the most crucial method to fixing the ssh related issues is to use `ssh -v` the verbose logging allows you to see what is going on.