The installation is done normally, i.e. on disk (No VM)
I have a script in which there are commands to be executed as a normal user and others as superuser. For example:
post-install_script.sh
sudo operation1 operation2 operation3 sudo operation4 operation5 ... This script must be run before Ubuntu sends the "Installation completed" notification but after all other installation operations (such as user creation).
There are many answers on the internet but none simple enough for me to understand how to proceed in my particular case.