The first script (lastline-virt) is configured to be executed as a service upon first boot. The main purpose of this script is to kick off the installation script and detach it from the execution shell. By detaching it from the shell, we make sure the OS does not kill the installation service since Linux enforces a time limit for starting services. Once the child script is detached, the parent removes itself from the list of services so it does not run again in the future. Then, it finished execution and exits with a success code to let the OS know everything went well, while the actual installation of the VM is still in progress running in the background.
The second script (lastline-virt-install) performs the actual creation/installation of the VM.