diff --git a/builder/qemu/builder.go b/builder/qemu/builder.go index 4ac22b59b..39984d68b 100644 --- a/builder/qemu/builder.go +++ b/builder/qemu/builder.go @@ -201,14 +201,15 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { b.config.VNCPortMax = 6000 } - if b.config.VMName == "" { - b.config.VMName = fmt.Sprintf("packer-%s", b.config.PackerBuildName) - } - if b.config.Format == "" { b.config.Format = "qcow2" } + if b.config.VMName == "" { + b.config.VMName = fmt.Sprintf("packer-%s.%s", + b.config.PackerBuildName, b.config.Format) + } + if b.config.FloppyFiles == nil { b.config.FloppyFiles = make([]string, 0) } diff --git a/website/source/docs/builders/qemu.html.markdown b/website/source/docs/builders/qemu.html.markdown index 651c69122..ab3935329 100644 --- a/website/source/docs/builders/qemu.html.markdown +++ b/website/source/docs/builders/qemu.html.markdown @@ -247,8 +247,10 @@ builder and not otherwise conflicting with the qemuargs): host port. - `vm_name` (string) - This is the name of the image (QCOW2 or IMG) file for - the new virtual machine, without the file extension. By default this is - "packer-BUILDNAME", where "BUILDNAME" is the name of the build. + the new virtual machine. By default this is "packer-BUILDNAME.FORMAT", where + `BUILDNAME` is the name of the build and `FORMAT` matches the `format` + option, above. If you customize this you must specify the file extension or + none will be used. - `vnc_port_min` and `vnc_port_max` (integer) - The minimum and maximum port to use for the VNC port on the host machine which is forwarded to the VNC