I’m working on an application which is running OK on Desktop Linux, but depends on adding the parameter ‘Experimental=true’ to the [General] section of /etc/bluetooth/main.conf. I also need to use a very recent version of BlueZ for my application to work (it needs to connect, pair and bond over BLE, and this depends on the org.bluez.Bearer.LE1 interface which has only become useful around 5.87).
I’m trying to understand how BlueZ works in a Balena container - does the /usr/sbin/bluetoothd in the container talk directly to the hardware or do the instructions need to be relayed to bluetoothd running on the host? If everything needs to be relayed does that mean that /etc/bluetooth/main.conf in the container is ignored and I won’t be able to turn Experimental mode on without modifying /etc/bluetooth/main.conf in the host (which I can see via a mount, but which seems to be read-only).
The codebase this is related to is available here if anyone is interested.
You usually should not treat /etc/bluetooth/main.conf on the BalenaOS host as a file you can edit in place and expect to keep. The host OS is meant to be atomically updated, and host-side edits in /etc are easy to lose on the next OS upgrade. If a setting is only needed inside a container, it is better to run BlueZ (or the stack that talks to it) in that container and configure it there, rather than opening the host config.
If you truly need a host-level BlueZ option such as Experimental = true, check whether the current supervisor / host OS already exposes that as a documented host configuration key, a udev/systemd drop-in, or a boot config. Those survive an OS bump; a one-off edit to main.conf often does not. Experimental itself is a BlueZ switch that enables features the daemon does not consider stable, so it is worth confirming you need that exact flag (for example a new advertising or management API) before turning it on on a fleet.
A useful test is: change the setting in a disposable device, reboot, then run an OS update and see whether the flag is still active. If it disappears, the durable path is a supported host config or a container-side BlueZ, not a bind-mount over /etc/bluetooth on the host. I would also keep experimental options off on production devices until the same behaviour is available in a non-experimental API, because a host update can change BlueZ’s experimental surface without warning.
@solartodo thanks for the clear advice that I’m better off not trying to modify the host’s /etc/bluetooth/main.conf.
You advised that I’d be better changing the BlueZ config inside my app’s container - I’m trying to understand whether this will work or whether the infrastructure for DBus inside a container sends the DBus messages to the host’s BlueZ install. The advice above seems to suggest that I should be able to use BlueZ 5.88 features in a container running that version even if the host is on an earlier version and/or is configured with Experimental=false. Is this so?
This is an open source hobbyist application related to controlling smart guitar amplifiers, so there is no production fleet to be worried about if it works on my machine and the machines of my small number of testers/contributors.