Understanding init scripts Opennebula (Files for VM)


I am wondering if anyone can help with understanding how the files section of a VM template works.

I ussually used the startup script which worked fine, but for a common startup script I would prefer to attach this as a file.

I have created init.sh and uploaded it, I have then typed in the name init.sh for the VM’s file.

When the VM boots it doesn’t run the init.sh file (I have tested the script works fine).

Am I doing something wrong with this?

EDIT: i can see its trying to access this file


Jul 9 10:37:43 Test one-contextd[1487]: chmod: cannot access ‘/tmp/one-context. 6M7wqE/init.sh’: No such file or directory

VM config

File in datastore

Hello @kingbuffalo

I tested and it works for me, could you please send me the template and oneimage show init.sh -x so I can help you.

Thanks, output is here:

bash-4.2$ oneimage show init.sh -x




1 1 0 0 -1 -1 2 files

Try to give execution permission (chmod u+x init.sh) before uploading it to OpenNebula and then upload it and test again.

Thanks I’ll give that a go , I created the .sh in sublime on windows so no Unix permissions will have been set , surely opennebula would chnod the file on upload ?

It depends on your datastore tm_mad, but it will copy the file as it is.