DaDesktop

Utilizing Hooks

About the Post-Clone Hook

A post-clone hook lets you execute custom scripts immediately after a machine has been cloned.

  1. Inside the /var/lib/kvm/yourtemplate or /var/lib/lxc/yourtemplate directory, create a shell script named post-clone.sh.
  2. The script's working directory is automatically set to the new machine's folder, so any relative paths operate within that context.

Important security note: The script runs with root privileges. A misconfigured script could inadvertently modify any file across the entire filesystem, so always test thoroughly.