Download Packer binary from here and add it to your path. Qemu and associated utilities will be needed.
Its better to use Bento project as a starting point and customize with extra scripts we need, rather than maintaining all of the configs needed to build with Packer. QEMU is supported even though its not listed. Command would be
packer build -only=qemu -var headless=true ubuntu-16.04-amd64.json
The below json is a packer-template to create an ubuntu 16.04 based appliance image, that would output qcow2 image for production, as well as box for developers to work with vagrant. User can pass variables using -var flag from packer build command-line to override defaults.