Setting up a display environment variable for a remote unix system

farm ostrich picture farm ostrich · Jan 23, 2011 · Viewed 31k times · Source

Trying to get some graphical network simulator (ns2) code to display from my university's unix system. My local OS is Ubuntu 10 and I am accessing the unix system through PuTTY SSH client. When some prewritten code is executed, the following error prompt occurs:

no display name and no $DISPLAY environment variable

What can be done to get remotely executed code to display on my system? I am a total novice with unix and my attempts at redefining the $DISPLAY env var were spectacular failures. Thanks. Appreciated.

Answer

thkala picture thkala · Jan 23, 2011

Just do:

$ ssh -X [email protected]

This should launch ssh with X forwarding enabled, when run from a terminal emulator like Xterm, gnome-terminal and the like. username should be your account name on the remote computer, of course.