# Packer Template for QEMU VM with Nested Virtualization This Packer template creates a QEMU-based virtual machine (VM) that can be used in Proxmox with nested virtualization enabled. It is designed for building other VMs inside this VM. ## Requirements - Packer - QEMU/KVM - Ubuntu 24.04 Server ISO - (Optional) Proxmox to run the image ## Usage ### Install Prerequisites - You can use the provided script to install all necessary tools on your host system or inside an existing VM: ``` ./scripts/install-prerequisites.sh ``` - This sets up tools like Packer, QEMU, and Docker. ### Build the image - Run the following command from the project root to build the image: ``` packer build ubuntu-qemu-template.json ``` - The resulting .qcow2 image will be saved in the `output/` directory. ### Post-Processing - After the build, the following script generates checksum files with the `scripts/create-checksums.sh` script. It produces .sums files with MD5 and SHA512 checksums. ### Using the VM - Import the image into Proxmox and enable nested virtualization. - You can then run this image as a VM capable of building other VMs using tools like Packer or Docker-in-Docker. ## Notes - The image uses Ubuntu 24.04 Live Server. - `scripts/sysprep.sh` prepares the image for reuse (e.g., clears logs, resets machine ID, etc.). - The template sets defaults like 2 CPUs, 2 cores, 2 GB RAM. - You can customize variables in the Packer template. ## File Structure - `ubuntu-24.04-server_vm-builder.json` – Main Packer configuration. - `scripts/install-prerequisites.sh` – Installs dependencies. - `scripts/sysprep.sh` – Cleans and prepares the image. - `scripts/create-checksums.sh` – Generates MD5/SHA512 checksums.