When I ssh to my target (Terasic DE10-Nano, a board with ARM A9 inside FPGA running Ubuntu 18.04 base) from my host (a laptop running Ubuntu 16.04 x86_64), the window created by the program I run on that target can be displayed on the host. That's because when I ssh to that target, the environment variable DISPLAY in the remote shell are always be automatically set to localhost:N.0, where N may be 10, 11, etc, by ssh.

However, when I use Eclipse on the host to remote-debug programs on the target, the window created by the debugged program can not be displayed on the host. Eclipse connects to the target using ssh, but the value of DISPLAY is not set and is blank (verified by: echo $DISPLAY). Once I set DISPLAY to localhost:10.0 in Eclipse, this issue will be solved. (In case it helps, here is how I set it: In Eclipse Oxygen.3's Debug Configuration > Main > Command to execute before application, set this field to export DISPLAY=localhost:N.0. And it's also necessary to manually ssh to the target and make sure the DISPLAY in that remote shell is localhost:N.0)

I'm wondering whether it is possible, during such Eclipse remote-debugging session, DISPLAY can be set automatically? If yes, then neither setting it in Debug Configuration nor manually sshing to the target is required.

1 Answer 1


One easy solution is that you can simply prepend the environment variable when launching eclipse:

DISPLAY=localhost:N.0; eclipse

You could then add an alias for this, for example:

alias eclipse-remote='DISPLAY=localhost:N.0; eclipse'

and put it in .bashrc (or .bash_aliases). Make source you run source .bashrc for the change to take effect.

  • Thanks for your comment. Unfortunately it doesn't work in this way: setting the variable DISPLAY in host's shell. DISPLAY need to be set in target's shell. May 4, 2019 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.