Bug 7548 - Cannot open display when running Gtk+ application as remote application
Summary: Cannot open display when running Gtk+ application as remote application
Status: RESOLVED WONTFIX
Alias: None
Product: Eclipse Plugin
Classification: Yocto Project Subprojects
Component: eclipse-plugin (show other bugs)
Version: 1.7.1
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.1 M4
Assignee: Jose Lamego
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-03-31 13:15 UTC by Joshua Lock
Modified: 2016-03-16 17:34 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Lock 2015-03-31 13:15:18 UTC
I'm trying to test the Eclipse plugin with Dizzy by using the skeletal projects provided by the Yocto Eclipse Plugin.

When I use the Gtk+ hello world project template I'm able to successfully build and deploy the binary however debugging and running the deployed binary fails with:

"Gtk-WARNING **: cannot open display:"

ADT Plug-in: 1.4.0 (installed from the 1.7.1/kepler software installation site)
Eclipse IDE: Kepler SR 2 (installed from a tarball downloaded from eclipse.org)
Poky: Dizzy HEAD (running the dizzy branch from git with a HEAD of ec75238f6cc2d2d8d40e0268f6d2acc070cbe9a4)
Toolchain: bitbake -c populate_sdk core-image-sato-sdk
OS: Ubuntu 14.10 x86_64
Comment 1 Joshua Lock 2015-03-31 15:49:37 UTC
Note, I'm working around this by setting "export DISPLAY=:0" in the "Commands to execute before application" field.
Comment 2 Jose Lamego 2016-01-21 17:17:13 UTC
Updating target milestone. Estimated person-days may be updated based on further analysis.
Comment 3 Jose Lamego 2016-03-16 17:34:30 UTC
The reported behavior is caused by a known issue in Eclipse that affects all releases and for which there is no fix to this day (Eclipse bug 195170: [1]).

This bug prevents Eclipse from supporting SSH port forwarding (tunneling), therefore host display cannot be opened when running/debugging as a remote application.

The following is a workaround that allows using host display by creating the tunneling outside Eclipse:

1. Launch a new terminal (external to Eclipse)
2. Start an SSH connection to the remote target using the -XY parameters to enable x11 trusted forwarding. DO NOT CLOSE THIS CONNECTION.
   For example: 'ssh -XY root@192.168.7.2'
3. In the C/C++ Remote Application Configuration properties, export the variable DISPLAY=:10.0 by entering this in "Commands to execute before application" field.
   For example: 'export DISPLAY=:10.0'
4. Run/Debug as Remote Application using this run configuration.

I've submitted a request to include this info in the Yocto Project Development Manual (Bug 9276).

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=195170