Home Creating a template for a VM
Post
Cancel

Creating a template for a VM

Creating a VM template let’s you create VMs from a template quickly.

  1. 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
  2. Install OS
    • Minimal OS install if applicable
    • DHCP
    • Disable LVM (if for Ubuntu)
    • Install SSH server
    • Eject OS CD when prompted
  3. Update and Upgrade OS
    1
    
    sudo apt update && sudo apt upgrade -y
    
  4. Install agent and other packages
    1
    2
    
    sudo apt update && sudo apt -y install qemu-guest-agent htop
    sudo systemctl enable qemu-guest-agent
    
  5. 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
    
  6. Power off the VM
  7. Convert VM to a template
This post is licensed under CC BY 4.0 by the author.