First Boot Script Not Running



I’m creating Debian-based VMs with everything else as the default apart from selecting “Add Script” as the Firstboot script option, then pasting in some shell code.

I started out with something that starts:


# Paste me as the ByteMark first run script

# Install Salt

/bin/echo 'deb stretch-saltstack main' >> /etc/apt/sources.list
/usr/bin/wget -O - | apt-key add -
/usr/bin/apt update
/usr/bin/apt install -y salt-minion

But that didn’t work. I simplified the code, tried sh rather than bash, got down to the minimal test case of:

/bin/touch /root/first-boot

and that doesn’t work either.

Does anyone have an example of a first boot script that works, or a suggestion for what I might be doing wrong?

Thank you.


Hi Rob, Rather than pasting in the commands to run, have you tried putting the touch(1) into a new shell script somewhere, make it executable, and then giving “Add Script” the full path to that script. Perhaps it just takes a command to execute with execve(2), whether it’s a script or not. Cheers, Ralph.