I've created an enhancement for VyOS which allows you to attach an ISO containing an initial configuration to a VyOS VM, and upon first boot it will detect the presence of the config and use it.
Implementation: https://github.com/jpsutton/vyos-firstboot
The idea here is that pretty much all hypervisors support attaching an ISO to a virtual machine, so using an ISO as a way to provide configuration data to a new VyOS VM is ideal. Here's the overview of it's operation:
- Upon first boot, the user is expected to attach an ISO file containing a valid VyOS configuration file named "vyosinit.cfg" in the root of the ISO.
- A start-up script detects the presence of an ISO9660 volume, and looks inside the volume (without needing to mount it) for a file with that name.
- If the filename is detected, it is extracted from the ISO and placed in /tmp.
- The normal process for loading a configuration file and saving it is used.
- A flag file is placed in /config in order to prevent subsequent boots from re-using the configuration file.
I've already made modifications to the vyos-build repo to support this change. I will submit a pull request for this change, as suggested in Slack.