How to point Amazon EC2 Linux DISPLAY to X11 on my Macbook?

I am trying to install Glassfish on my new Amazon EC2 Linux instance.

The installation tells me to set the DISPLAY variable.

I determine my IP using http://www.whatismyip.com (e.g. 123.45.67.89)

I open X11 on my Mac and set the ip address on Linux (for example, export DISPLAY = 123.45.67.89)

But installing Glassfish throws an exception

 java.lang.InternalError: Can't connect to X11 window server using '123.45.67.89' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) ... 

Any ideas?

+4
source share
1 answer

Your Mac will most likely not make X accessible through remote interfaces (relatively normal by default). The idiomatic way to do this is to tunnel through ssh , which has a convenient advantage, eliminating the need to configure the DISPLAY variable (not to mention saving you the confusion when entering your credentials into glass fish!).

From your mac:

 ssh -X user@remotehost 

Now, on remotehost :

 ./run_glassfish_somehow 
+3
source

All Articles