"No X11 DISPLAY variable was set" error - Amazon EC2 / SSH

1

I'm trying to install APT on an Amazon EC2 through PuTTY. I've uploaded APT, found here, and followed these instructions to install. However, when I run sh install-linux64-apt.sh in the proper directory, the result is an error:

No X11 DISPLAY variable was set [...]

So I looked this problem up, and found an answer here. However, running setenv DISPLAY :0.0 or export DISPLAY=:0.0 both result in a failure of some sort (the first fails, and the second does nothing at all). So that answer doesn't help much.

What's the solution for this case?

user317572

Posted 2014-05-02T00:01:20.370

Reputation:

Dealing with Linux from the command line is a real test of patience if you're new to it. Every time you solve one issue, another 2 or 3 seem to be waiting.. – None – 2014-05-02T00:03:50.233

A version of Ubuntu that controlled a remote machine would be fantastic. Short of that, any GUI to control an EC2 remotely would be great. The command line is painful if you didn't grow up on it. – None – 2014-05-02T00:05:43.057

Answers

4

export DISPLAY=:0.0 normally defines a graphics display physically attached to the computer. You're remotely connecting to the EC2 instance, so that's not what you want.

SSH, including putty, has an option to forward X from the remote system to your local display. It will set the DISPLAY environment variable for you. With putty, Go into Configuration->Connection->SSH->X11 and enable X11 forwarding.

However, for that to work, you need to have an X server on your local system. If your local system is Linux, and you're using the graphical console, then you should be fine. If your local system is Windows, then you probably don't have an X server. There is X server software for Windows. Or you could use MobaXTerm, which is an SSH client like putty with a built in X server.

Kenster

Posted 2014-05-02T00:01:20.370

Reputation: 5 474

This was a helpful response but I have one addendum: I tried setting this up from a client (with the windows X-server) behind a corporate firewall, and it wouldn't work. My hunch is that there had to be some special tunnel in the firewall that wasn't in place, meaning that the external (amazon) linux box couldn't "see" my client on the requisite port for X protocol interactions. – None – 2014-12-10T16:59:53.907

1perfect. Now I understand. – None – 2014-05-02T19:00:27.840