Creating a VM template let’s you create VMs from a template quickly.
- Create a new VM
- Two cores
- 2 GB of memory
- 32 GB of storage
- QEMU enabled (for Proxmox)
- Add cloud-init drive and settings (for Proxmox)
- Mount OS installation ISO
- Install OS
- Minimal OS install if applicable
- DHCP
- Disable LVM (if for Ubuntu)
- Install SSH server
- Eject OS CD when prompted
- Update and Upgrade OS
1
sudo apt update && sudo apt upgrade -y
- Install agent and other packages
1 2
sudo apt update && sudo apt -y install qemu-guest-agent htop sudo systemctl enable qemu-guest-agent
- Apply Ubuntu DHCP fix
1 2 3 4
sudo rm /etc/machine-id sudo rm /var/lib/dbus/machine-id sudo touch /etc/machine-id sudo ln -s /etc/machine-id /var/lib/dbus/machine-id
- Power off the VM
- Convert VM to a template