Using the QEMU builder
The QEMU builder is arguably the most powerful builder available to Packer. QEMU allows you to specify the qemu-system
binary that’s used during a build. This means you can cross-build images for other architectures that are supported by QEMU, including ARM, AArch64, IBM Power, S390/X, and even microcontrollers. QEMU is probably the most flexible local builder available, even though it’s not the most commonly used. QEMU’s KVM acceleration requires supported platforms, so builds are generally performed on Linux:
Figure 3.2 – Legacy images created with Packer and qemu-system-ppc
The QEMU builder also has one unique feature, which is TTY forwarding. The console output from the VM’s default TTYS0 can be output into Packer logs. You can record a VM building line by line, even in headless mode, which is helpful for troubleshooting. To include TTY output, you must use the PACKER_LOG=1
environment variable...