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.
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:
On Macbook update firewall rules so that it is allowing incoming connections for the XQuartz application.
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.
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.
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.