Post-Clone Hooks

Post-Clone Hook Trigger

Once a machine has been cloned, the post-clone hook lets you run custom code automatically.

  1. Create a file named post-clone.sh inside the /var/lib/kvm/yourtemplate or /var/lib/lxc/yourtemplate folder.
  2. The working directory will be set to the machine that was just cloned.

Important: the script executes with root privileges. An incorrectly written script could overwrite any file on the entire filesystem.