Packer QEMU performance: speed things up with two-stage builds
Introduction
In the “Packer QEMU: Building Ubuntu 20.04/22.04/24.04 VM images” blog post we briefly mentioned ways to improve Packer QEMU performance. In this article we’ll go into the details on how this is implemented. The key in improving Packer QEMU performance is to split the build into two distinct stages:
-
Operating system installation stage
-
Provisioning stage
This setup cuts down development time considerably as repeating the provisioning stage becomes a lot faster.
Packer QEMU: Building Ubuntu 20.04/22.04/24.04 VM images

Introduction
Packer QEMU builder allows you to build virtual machine images from scratch. You need a Packerfile, an automatic installation configuration file (autoinstall, kickstart or preseed) and the operating system installer (e.g. ISO). The benefit of Packer QEMU in particular are that you can have fine-grained control over the virtual machine image content such as disk partitioning. Moreover you don’t need to rely on official base images produced by other people, such as the official Ubuntu Cloud images.