Customizing Linux Templates
Employ a kernel optimized for virtualization
Utilize the linux-image-kvm kernel, which is specifically designed for KVM virtualization environments.
For instance, within an Ubuntu setup, you'd run the following commands:
apt install linux-image-kvm apt purge linux-image-generic
Perform cleanup prior to template publication
# removes logs journalctl --vacuum-size=1 # removes user history history -c
(as root) rm /root/.bash_history