# How to modify a ResinOS img to switch from an app to an other

**URL:** <https://forums.balena.io/t/how-to-modify-a-resinos-img-to-switch-from-an-app-to-an-other/1787>\
**Category:** Product support\
**Tags:** support\
**Created:** [August 31, 2017, 4:22pm UTC](https://forums.balena.io/t/how-to-modify-a-resinos-img-to-switch-from-an-app-to-an-other/1787 "2017-08-31T16:22:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tristan107](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tristan107/32/381_2.png) [@Tristan107](https://forums.balena.io/u/Tristan107)\
**Post date:** [August 31, 2017, 4:22pm UTC](https://forums.balena.io/t/how-to-modify-a-resinos-img-to-switch-from-an-app-to-an-other/1787/1 "2017-08-31T16:22:37Z")

</div>

When downloading a new ResinOS image preconfigured for your application, you have the “advanced” option to “Download configuration file only”.

I guess this option allow you to reuse a downloaded image for an other application without downloading again the full 1.8 Go (I know it’s compressed during download, but still).

Is there a doc somewhere on how to use this configuration file on an existing image ? Do you have to edit it (name and/or content) ? What would be the software to mount and edit the .img file without flashing it on a microSD card ?

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 31, 2017, 4:40pm UTC](https://forums.balena.io/t/how-to-modify-a-resinos-img-to-switch-from-an-app-to-an-other/1787/2 "2017-08-31T16:40:06Z")

</div>

@Tristan107 You have a few options:

- burn your image, take the downloaded `appnicationslug.config.json` and replace the `config.json` on the SD card or USB stick that you’ve burned to (resin-boot partition). Just have to make sure that the image and the configuration are for the same device types.
- burn your image, and run the resin-cli to inject the configuration: `sudo resin config inject appnicationslug.config.json --type devicetype` and it will prompt you for your SD card or USB stick path
- you can modify the image to put the config.json there, replacing the one that it was downloaded with: take the image file and mount the `resin-boot` partition from there (recommend using `kpartx -a resin-applicationslug-xyz.img`), and copy the `appnicationslug.config.json` there over the `config.json`. Unmount and detach with `kpartx -d ....`, and then when you burn the file, you will get devices for that application.

How are these? And yeah, we’ll need to document more of the nitty-gritty of these advanced options and their usage.

Btw, the compressed image is on the order of ~140MB for the Pi for example, you can choose to download the `.gz` images for example to see that - it’s the same compression just explicitly. Or you can choose `.zip` compression there too.

---

<div class="post-metadata">

**Author:** ![Tristan107](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tristan107/32/381_2.png) [@Tristan107](https://forums.balena.io/u/Tristan107)\
**Post date:** [August 31, 2017, 5:06pm UTC](https://forums.balena.io/t/how-to-modify-a-resinos-img-to-switch-from-an-app-to-an-other/1787/3 "2017-08-31T17:06:19Z")

</div>

Ok, thanks for this quick and complete answer !

Just one more thing : Does the downloaded file has to be renamed to config.json to be recognized or any file with \*.config.json naming pattern is ok ?

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [September 1, 2017, 7:06am UTC](https://forums.balena.io/t/how-to-modify-a-resinos-img-to-switch-from-an-app-to-an-other/1787/4 "2017-09-01T07:06:00Z")

</div>

It has to be `config.json`. Naturally there can be only one config file for one device / one SD card, so it has a fixed name.
