[Qt-creator] How to make QtCreator to connect to a remote device (generic linux) with X forwarding enabled `ssh -X`?

Иван Кувалдин i.kyb at ya.ru
Mon Dec 18 12:48:12 CET 2017


Ура! Thank you, guys for support and ideas.

Now I can make the app running on a remote machine open its graphics on a local development machine.
Steps:

1. Open ssh session with X forwarding enabled
     
    ssh -X user at host

2. Get know forwarded display identity:
  
      echo $DISPLAY
  
  Will return something like `localhost:11.0`

3.Set environment variable DISPLAY for your run configuration in QtCreator to that value like `localhost:11.0`

4. Enjoy.


-- 
Best regards
Ivan Kuvaldin


18.12.2017, 12:24, "Konstantin Tokarev" <annulen at yandex.ru>:
> 18.12.2017, 12:56, "Иван Кувалдин" <i.kyb at ya.ru>:
>>  Hello.
>>
>>  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 works fine there too. But when I run the app on the remote host through QtCreator, it 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`?!
>>  I believe there is a hidden configuration option in some file, and no need to recompile.
>>  Thanks in advance.
>
> Note that Qt Creator does not use system ssh client for running remote processes,
> but uses internal SSH client library built on top of Botan. So it's not possible to pass
> arbitrary arguments of openssh client to some magic place and get its behavior.
>
> Advice with setting DISPLAY variable seems to be closer to what this feature was
> originally meant to do: run application on remote device in the same way as it would be
> run there normally. X11 forwarding runs application remotely but using your local X server
> to display it.
>
>>  Related Questions:
>>   0. https://forum.qt.io/topic/86047/how-to-make-qtcreator-to-connect-to-a-remote-device-generic-linux-with-x-forwarding-enabled-ssh-x
>>   1. https://stackoverflow.com/questions/47838027/how-to-remotely-debug-graphic-application-with-qtcreator
>>
>>  --
>>  With best regards Ivan Kuvaldin
>>  С уважением Иван Кувалдин.
>>  _______________________________________________
>>  Qt-creator mailing list
>>  Qt-creator at qt-project.org
>>  http://lists.qt-project.org/mailman/listinfo/qt-creator
>
> --
> Regards,
> Konstantin



More information about the Qt-creator mailing list