How do I create a custom ubuntu images?

I have got an ubuntu18.04.4 image from here: http://images.maas.io
How do i customize the image?

Thanks

There’s some documentation here: https://maas.io/docs/custom-node-setup-preseed.
I just needed some extra packages installed by default when I deploy a Ubuntu 18.04 machine, so I used a curtin template. The two things I had to work out were the name of the template file I created, and that I needed to make a copy of the ‘curtin_userdata_custom’ file and then append the commands I needed to the ‘late_commands’ section of the file.
So, for example, we wanted all Ubuntu 18.04 machines to deploy with python2. From the /etc/maas/preseeds folder:
$ sudo cp curtin_userdata_custom curtin_userdata_ubuntu_amd64_generic_bionic
The name of the new file targets all Ubuntu 18 machines on amd64. At first I tried making a curtin template with only my command in the 'late_commands" section, but that didn’t work. I had to include the entire contents of ‘curtin_userdata_custom’. Then, I added this line to the late_commands: section of curtin_userdata_ubuntu_amd64_generic_bionic:
10_python_minimal: ["curtin", "in-target", "--", "apt", "install", "-y", "python-minimal"]
You could add more packages in one line, if you want.

Hope this helps, happy trails! :cowboy_hat_face: :sunglasses:

2 Likes