# Combining "balena os configure" arguments

**URL:** <https://forums.balena.io/t/combining-balena-os-configure-arguments/374451>\
**Category:** balenaOS\
**Tags:** balena-cli\
**Created:** [June 19, 2025, 2:24pm UTC](https://forums.balena.io/t/combining-balena-os-configure-arguments/374451 "2025-06-19T14:24:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartvanderhoeven12](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@bartvanderhoeven12](https://forums.balena.io/u/bartvanderhoeven12)\
**Post date:** [June 19, 2025, 2:24pm UTC](https://forums.balena.io/t/combining-balena-os-configure-arguments/374451/1 "2025-06-19T14:24:03Z")

</div>

Hi,

I’m flashing Raspberry Pi CM4s with balena OS. I have it setup such that the device is first registered in balenaCloud. I take the device UUID (used for later reference in our db) and then use the same UUID to flash it. I prepare the image before flashing with `balena os configure --device <uuid>`

But now I want to combine this with a premade config.json containing udev rules. To my surprise if I use `balena os configure --device <uuid> --config config.json`, the final image does not contain the pregenerated UUID anymore and when the device comes online it gets assigned a new UUID automatically.

Is this intended behavior? And if so, is there another way to inject both the udev rules and a device UUID into the image?

---

<div class="post-metadata">

**Author:** ![otaviojacobi](https://avatars.discourse-cdn.com/v4/letter/o/94ad74/32.png) [@otaviojacobi](https://forums.balena.io/u/otaviojacobi)\
**Post date:** [June 19, 2025, 6:04pm UTC](https://forums.balena.io/t/combining-balena-os-configure-arguments/374451/2 "2025-06-19T18:04:36Z")

</div>

Hello @bartvanderhoeven12

How do you generate the config.json? Effectively the config.json file has a uuid of its own (with associated device api key, so it can’t be simply overriden). If you are generating the config file with `balena config generate` I would reccomend you pass the device uuid there

---

<div class="post-metadata">

**Author:** ![bartvanderhoeven12](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@bartvanderhoeven12](https://forums.balena.io/u/bartvanderhoeven12)\
**Post date:** [June 20, 2025, 8:10am UTC](https://forums.balena.io/t/combining-balena-os-configure-arguments/374451/3 "2025-06-20T08:10:18Z")

</div>

Hi,

Right now I used a pregenerated config.json from balenaCloud (and then inserted custom key/value pairs with jq on CLI). But now I see you mention `balena config generate` (and I suppose I would use `balena config write` to write the udev rules into the config file). I must have looked over these commands, this seems to be what I was looking for.

Thanks a lot!
