2
votes

I'm remote debugging a qt application from one ubuntu machine to another ubuntu one. I can do it from the console with:

root@eclipsePC# sudo ssh apppcIP -X
root@appPC# export DISPLAY=:0.0
root@appPC# gdb myApplication

Now I'm trying to do the same with Eclipse cdt (starting eclipse with sudo). I've defined the remote connection as a Linux type system. It works for application with no graphics, but for my qt application I get:

Listening on port 2345 Remote debugging from host "myEclipseIP"

myApp: cannot connect to X server

Child exited with status 1

GDBserver exiting logout

I've tried doing

root@appPC# xhost +
root@appPC# export DISPLAY=:ECLIPSEPCIP:0.0

but it didn't work. Anyone knows how to do this? Thanks

I've added the argument -display ECLIPSEPCIP:0.0 in the debug config and now it starts, but in the appPC instead of the host ECLIPSEPC.

1
Did you try setting display environment variable only to :0 -> export DISPLAY=:0scriptmonster
why are you using a colon (:) before the IP in the export DISPLAY?KikoV
Thank you for the suggestions but they didn't make any diference.Katu

1 Answers

1
votes

You can enforce ssh X11 forwarding using the ssh config file:

Add the following lines to your $HOME/.ssh/config:

Host apppcIP
  ForwardX11 yes

I guess there should be also an option in eclipse to configure -X for the ssh connection, but I'm not sure and have no eclipse for testing. However, the solution shown above will work regardless of eclipse's feature set.


Further, you should not start eclipse as root, also root to root ssh connections are considered insecure. Make sure the regular user can connect to the remote host and execute the necessary commands there.