Configure Bluez on Host OS from Container

I am running an application in a container that requires Bluetooth functionality. The application works okay but I need to manually copy a Bluez dbus policy configuration file to /etc/dbus-1/system.d on the Host OS similar to this post. This needs to be done for each device on the fleet. I want to know if it’s possible to configure the Host OS while building the container without having to manually configure the Host OS. Thanks.

Hi, welcome to the forums. The root filesystem for balenaOS is read-only and cannot be modified persistently. All services running in the hostOS are meant to be used by the hostOS, and the application is meant to run anything it requires by itself.
In this case, you would use the dbus bloc and a bluetooth block and modify them to your needs. In the end you will be running a separate dbus and bluez services that will only be used by the applicaition. In the case of bluez, you may also stop the one running in the hostOS as it will not be used.
By running them in the application you get complete control over their configuration and life cycles, and you do not interfere with the services that the hostOS needs to work.