Linux Sysprep [top] [ ULTIMATE ]

Run it as root, then capture the image from the powered-off VM. When you deploy from this image, pass cloud-init user-data:

echo "=== Sysprep complete. Shutting down for imaging. ===" shutdown -h now linux sysprep

preserve_hostname: false manage_etc_hosts: true ssh_pwauth: false disable_root: false Here is the battle-tested, distro-agnostic flow for Linux sysprep: Step 1: Provision a "clean" VM (not container) Build a VM exactly how you want your golden image: packages, configs, users, hardening. Step 2: Run the Generalization Script Save this as /usr/local/sbin/sysprep-linux.sh : Run it as root, then capture the image