aboutsummaryrefslogtreecommitdiff
path: root/packer
diff options
context:
space:
mode:
Diffstat (limited to 'packer')
-rw-r--r--packer/README.md55
-rw-r--r--packer/ubuntu-24.04-server_vm-builder.json (renamed from packer/ubuntu-24.04-server.json)0
2 files changed, 55 insertions, 0 deletions
diff --git a/packer/README.md b/packer/README.md
new file mode 100644
index 0000000..e688802
--- /dev/null
+++ b/packer/README.md
@@ -0,0 +1,55 @@
+# 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.
diff --git a/packer/ubuntu-24.04-server.json b/packer/ubuntu-24.04-server_vm-builder.json
index 397bdba..397bdba 100644
--- a/packer/ubuntu-24.04-server.json
+++ b/packer/ubuntu-24.04-server_vm-builder.json