How to make QtCreator to connect to a remote device (generic linux) with X forwarding enabled `ssh -X`?
-
I develop a cross-platform Qt application with GUI. It works fine on host system in both x32 and x64 variants. Next is to deploy the application on a remote i386 host. It seems to work fine there too, but the app fails to connect to a display, because it does not exist. The solution is to access to remote host with
-X
option. Definitely. This way it opens window(s) on a local (development) machine.How to explain QtCreator->Tools->Devices module to connect via
ssh -X
?!
Thanks in advance. -
Hi,
From a quick look at Qt Creator source code, I don't think it's possible currently. However, you should double check with the folks on the Qt Creator mailing list. You'll find there Qt Creator's developers/maintainers.
-
Thank you, @SGaist, I followed you advise and community helped to find a solution.
The way is simple:
- Open ssh session to remote host with X forwarding enabled
ssh -X user@host
. And get know theDISPLAY
variable. For example withecho $DISPLAY
. It should look likelocalhost:10.0
. - Set environment variable
DISPLAY
in QtCreator -> Projects -> YourConfiguration -> Run -> RunEnvironment to known value from (1). - Run and enjoy remote debug with GUI on local machine.
Note: closing ssh session will make forwarded display inaccessible and invalid.
- Open ssh session to remote host with X forwarding enabled