Refining Linux Templates

Employ Virtualization-Specific Kernels

Leverage the linux-image-kvm kernel, which is specifically engineered for KVM virtualization environments.

For instance, on Ubuntu, you should execute the following commands to achieve this:

apt install linux-image-kvm
apt purge linux-image-generic

Sanitize Before Template Publication

# removes logs
journalctl --vacuum-size=1
# removes user history
history -c
(as root) rm /root/.bash_history