How to get X client application running in a balena service displaying its output on my XQuartz server running on my macbook?

I want to launch an X client application in one of my balena services (I am having a multiple container application) and getting the output displayed on XQuartz server that is running on my macbook. Both the balena device and my macbook are connected to the same network.

Any idea if this is possible and how I can set this up ?
many thanks
Jan.

Does this blog post help with this? https://www.balena.io/blog/running-a-gui-application-with-balenacloud/

It sounds like it would…

If not…

I’m not terribly familiar with how XQuartz works but if you can connect to a X server running on the network, you should only need to expose the x socket on you balena device and it should work

Wait… you want to use the X server on the macbook not the one on the device. In that case you would need to figure out how to expose that xquartz server to the local network and then configure you application on the balena device to look for that.

Thanks for the advice. I managed to get it working by following steps:

  1. On Macbook update firewall rules so that it is allowing incoming connections for the XQuartz application.
  2. On Macbook, start XQuartz application, and then in Preferences>Security select Allow connections from network clients. It might be needed to restart XQuartz to make the changes come into effect.
  3. On Macbook in a terminal window run xhost + <ip address balena device> - Note that my balena services are running with network mode = host. The xhost command authorizes the client to connect to XQuartz X-server.
  4. On BalenaCloud Dashboard: in terminal window of respective service: enter export DISPLAY=<ip address MAC book>:0 and then you can launch your xclient application (e.g. xeyes) and the output should appear on your macbook screen.

Nice :tada: do you mind sharing what you’re doing with this?

Sure. The pulseaudio tool pavucontrol is an xclient application which I would like to get working.