# Appliance Creation based on Ubuntu 22.04 distro

**URL:** <https://forum.opennebula.io/t/appliance-creation-based-on-ubuntu-22-04-distro/12131>\
**Category:** Integration Support\
**Created:** [May 17, 2024, 8:36pm UTC](https://forum.opennebula.io/t/appliance-creation-based-on-ubuntu-22-04-distro/12131 "2024-05-17T20:36:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cfragkos](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@cfragkos](https://forum.opennebula.io/u/cfragkos)\
**Post date:** [May 17, 2024, 8:36pm UTC](https://forum.opennebula.io/t/appliance-creation-based-on-ubuntu-22-04-distro/12131/1 "2024-05-17T20:36:06Z")

</div>

Hello OpenNebula Team!

I want to create an appliance based on the Ubuntu 22.04 distro in order to upload it to a common OpenNebula marketplace with the other partners of the project. This appliance will include a service installed via a process of six commands. I have watched the OpenNebula webinar: “Introducing one-apps project, an OpenNebula appliance building tool,” and I have some questions.

To create this appliance, should I follow the approach demonstrated with the MariaDB service, or is there a different approach I should take? Specifically, I am aiming to create an Ubuntu Image appliance with a service installed, rather than a service appliance.

If I modify `one-apps/packer/ubuntu.10-upgrade-distro.sh` to include the commands needed to install my service, will that work? Should I follow the same approach shown in the webinar?

Thank you for your time!

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [May 20, 2024, 2:34pm UTC](https://forum.opennebula.io/t/appliance-creation-based-on-ubuntu-22-04-distro/12131/2 "2024-05-20T14:34:52Z")

</div>

In general, the approach followed on the webinar is the “ideal” scenario for a bash based approach. What you could really change is using the ruby framework (more modern one, there is a note about that in the webinar) instead of the bash one.

> I am aiming to create an Ubuntu Image appliance with a service installed, rather than a service appliance.

Would you mind explaining this ?

> If I modify `one-apps/packer/ubuntu.10-upgrade-distro.sh` to include the commands needed to install my service, will that work? Should I follow the same approach shown in the webinar?

You can place your logic wherever you want, but if the intention is to create a custom appliance, it would be ideal to have a dedicated script for it and referencing it within the packer code. That script is used in the base ubuntu distro building.

---

<div class="post-metadata">

**Author:** ![cfragkos](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@cfragkos](https://forum.opennebula.io/u/cfragkos)\
**Post date:** [May 25, 2024, 7:38pm UTC](https://forum.opennebula.io/t/appliance-creation-based-on-ubuntu-22-04-distro/12131/3 "2024-05-25T19:38:09Z")

</div>

Hello Daniel, thanks for the response!

Yes, actually my intention is to create a custom appliance based on the Ubuntu distro.

So,

1. If I clone the one-apps repo and create a new script in the one-apps/packer/ubuntu directory with the logic of the appliance that I want to have

2. Then execute this script through the one-apps/packer/ubuntu/80-install-content.sh script

3. And finally execute `make ubuntu` (in order to build it)

Is this approach going to work?

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [May 27, 2024, 2:37pm UTC](https://forum.opennebula.io/t/appliance-creation-based-on-ubuntu-22-04-distro/12131/4 "2024-05-27T14:37:30Z")

</div>

Yes it will work, however

- **ubuntu** is not a good name for a custom app, it could be confusing as there is already ubuntu flavours. But is not a big deal as long as users are aware.
- you want to execute the script through another script. This means you’d need to modify said script which is stock OpenNebula script.
  - If for some reason we change that context install script, then you’ll need to maintain the change sync.
  - Why not simply add another script with a numbered order ? Packer will call it sequentially.

---

<div class="post-metadata">

**Author:** ![cfragkos](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@cfragkos](https://forum.opennebula.io/u/cfragkos)\
**Post date:** [May 28, 2024, 10:58am UTC](https://forum.opennebula.io/t/appliance-creation-based-on-ubuntu-22-04-distro/12131/5 "2024-05-28T10:58:19Z")

</div>

So, if I create a script in `one-apps/packer/ubuntu/99-add-logic.sh` with the logic of the appliance that I want to create, will it be called automatically?

Yes, I agree that the name “ubuntu” is not a good name for a custom appliance. If I change the variable `appliance.name` in `one-apps/packer/ubuntu/variables.pkr.hcl`, will it work?

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [May 28, 2024, 4:16pm UTC](https://forum.opennebula.io/t/appliance-creation-based-on-ubuntu-22-04-distro/12131/6 "2024-05-28T16:16:05Z")

</div>

Please check [this PR](https://github.com/OpenNebula/one-apps/pull/76) for the code example showcased in the webinar. The script will be called due to how [packer references them](https://github.com/OpenNebula/one-apps/blob/7921e5c9b22ab86d8118f62f02af8116fee9e90a/packer/ubuntu/ubuntu.pkr.hcl#L58-L67).
