Post-Installation script

vongolashu

New Member
Feb 9, 2017
2
0
1
30
Is there any way to run a post-installation script (bash) when a new VM is created using a fresh linux image or a template ?

I want to create and setup Nginx/FTP (well LEMP) automatically when a new VM is created.
I thought about creating a template with both of them installed but that will leave the problem of passwords being pre-generated or not known.

PS: Above use-case is to deploy the VM through WHMCS module
 
Is there any way to run a post-installation script (bash) when a new VM is created using a fresh linux image or a template ?

I want to create and setup Nginx/FTP (well LEMP) automatically when a new VM is created.
I thought about creating a template with both of them installed but that will leave the problem of passwords being pre-generated or not known.

PS: Above use-case is to deploy the VM through WHMCS module

A VM can be created via CLI as follows:

Code:
qm create <vmid> [OPTIONS]

This command string you can put into a script and add additional commands as you like.

See also
Code:
man qm
 
A VM can be created via CLI as follows:

Code:
qm create <vmid> [OPTIONS]

This command string you can put into a script and add additional commands as you like.

See also
Code:
man qm

Sorry I didn't quite get it, can you please provide a example command to create a VM and then run a command line/bash in hat VM ?
For example, if I want to run command "apt-get install nginx" after VM creation automatically
 
Sorry I didn't quite get it, can you please provide a example command to create a VM and then run a command line/bash in hat VM ?
For example, if I want to run command "apt-get install nginx" after VM creation automatically

you need to do this yourself - there's a myriad of solutions out there, ranging from "roll your own shell scripts" to stuff like chef/puppet/ansible/..