Proxmox VE - How to build an Ubuntu 22.04 Template (Updated Method)

Originally published at: Proxmox VE – How to build an Ubuntu 22.04 Template (Updated Method) – Learn Linux TV

Proxmox Virtual Environment is a powerful and easy to use virtualization platform with many features. Virtual machine templates help to minimize the amount of time spent building new instances, and in this video we’ll take a look at how you can utilize Ubuntu’s cloud images to automate the process of deploying new Linux instances.


One small issue. .img files are raw FS formats. .qcow2 file are different formats and you need your file to be formatted as such. If you run a file ubuntu-22.04.qcow2 you will most likely see that the file type is not actually qcow. The only way to fix that is to create the proxmox VM and add the ubuntu image as a raw file instead of qcow2, then under proxmox to “convert to qcow2.” That’s how it works when you are working with files on a NFS share, however, at the end you import the file to local-lvm. That means you are creating a logical volume and importing the partition data in LVM. So it’s not even qcow2 anyway, it is a raw fs image…

Personally I never liked the proxmox LVM(-thin) option, I always deleted that and created a path or new volume under the same VG and mounted it locally, then sent the images there. Way easier to work with.

1 Like

I got around to watching the tutorial, just because I can always learn something, even when I am guessing I already know what’s being done there.

The reason why the import fails with the .img file name is because KVM only supports .raw and .qcow2 disk image formats. So instead of renaming it .qcow2, try renaming it to .raw. This should allow you to import it and then if needed, convert it to qcow2 later. Funnily enough, when using either local ZFS or local LVM, I cannot select anything other than .raw files when creating a virtual disk. This is most likely because the FS takes care of the snapshot capabilities (both ZFS and LVM have built-in snapshot capabilities). If using a NFS share, I think the .qcow2 option gets enabled. Back at my old workplace, we were using NFS and converted all images from .raw to .qcow2. Funnily enough, the operation can be done live while the VM is running! And you can do it in both directions (from raw to qcow2 and from qcow2 to raw).