I found this to be a great video. If video formats are more your thing, definitely stop reading my blog and check this video out. This video walks through using a Cloud Init operating system, which I used for years, but I was never able to get my operating system to interact with USBs. I am sense moving away from a Cloud Init operating system, and will therefore refer to Ubuntu Server below instead.

Proxmox is a “hypervisor”, which means it allows you to setup virtual machines (VMs). I’m a big fan of running home server as a VM, and inside of that VM, I run numerous services as Docker Compose services.

I’ve found it extremely convenient to have a Promox VM template configured, as it allows me to easily create a other VMs, using the same setup. Say for exploration, or testing purposes.

  1. SSH into your Proxmox instance.
  2. Navigate to a directory where we can download an ISO file, creating it if it does not exist
mkdir -p /var/lib/vz/template/iso && cd /var/lib/vz/template/iso
  1. Download the VM ISO you wish to use. I’m going to use Ubuntu 24.04 LTS Server:
curl https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso --output ubuntu-24.04-live-server-amd64.iso
  1. Download a few tools to our Proxmox server to make our lives easier:
apt update && apt install vim tmux htop -y
  1. Create the virtual machine:
qm create 8001 --memory <amount of memory in MB> --name <VM name> --net0 virtio,bridge=vmbr0

Please note that 8001 is the VM ID. For this guide, we’ll use 8001, but you may select a different number if that is already in use.

  1. Import the downloaded OS to the local-lvm storage:
qm importdisk 8001 ubuntu-24.04-live-server-amd64.iso local-lvm

You should see some successful output that looks like this:

Successfully imported disk as ‘unused0:local-lvm:vm-8001-disk-0’

  1. Configure the VM by adding scsi controller, scsi drive and attaching the device:
qm set 8001 -scsihw virtio-scsi-pci --scsi0 local-lvm:vm-8001-disk-0
  1. Add the bootable drive
qm set 8001 --ide2 local-lvm:vm-8001-disk-0
  1. Make the bootable drive, bootable, and restrict BIOS to boot from disk only
qm set 8001 --boot c --bootdisk scsi0
  1. Enable a serial port, which is required to enable web VNC.
qm set 8001 --serial0 socket --vga serial0
  1. At this point we have finished preparing ubuntu-server VM Proxmox. If there is another other package you wish to install, or any other configuration you wish to do, do so now. Be mindful to keep this minimized, as we’ll use it as a cookie cutter for all other VMs.

  2. We could start using this VM now, however we should go one step further. Let’s turn this VM into a reusable template, and create a fresh VM from said template. This allows us to create multiple similar VMs with ease. To achieve this, either right click on the VM in the Proxmox UI and click Convert to template or run:

qm template 8001

You may see output like this:

Renamed “vm-8001-disk-0” to “base-8001-disk-0” in volume group “pve” Logical volume pve/base-8001-disk-0 changed. WARNING: Combining activation change with other commands is not advised.

  1. Let’s continue by cloning the machine into a new VM called Yoshi:
qm clone 8001 135 --name yoshi --full
  1. If the original template’s designated number of CPU sockets, vcpus or memory, we can leverage the qm set command to modify this. Be sure the VM is stopped before running this.
qm set 8001 --memory <> --sockets <number of desired CPU sockets> --vcpus <desired number of hotplugged vcps>
  1. Now you may start the cloned VM named Yoshi. On boot, you’ll be greeted with GNU GRUB, which will allow you to select Try or Install Ubuntu Server.

  2. If Proxmox Console UI for the Yoshi VM is stuck, I’d recommended starting the VM. If that does not solve it, try modifying the VM Hardware > Display, and select Default.

  3. Step through the OS installation steps, to prepare your VM.

References