The version of the box that is added is always v0
; how can I change this value? For example, when I do a vagrant box list
, my box is always version v0
.
I'm creating a VirtualBox Vagrant "box" using Packer, but I can't figure out how to set the version of the box output.
The Packer build command consumes a builder JSON file
$ packer build builder.json
...
==> virtualbox-iso (vagrant): Creating Vagrant box for 'virtualbox' provider
virtualbox-iso (vagrant): Copying from artifact: dist-28/ion-disk001.vmdk
virtualbox-iso (vagrant): Copying from artifact: dist-28/ion.ovf
virtualbox-iso (vagrant): Renaming the OVF to box.ovf...
virtualbox-iso (vagrant): Compressing: Vagrantfile
virtualbox-iso (vagrant): Compressing: box.ovf
virtualbox-iso (vagrant): Compressing: ion-disk001.vmdk
virtualbox-iso (vagrant): Compressing: metadata.json
and the output of the Packer step above is Vagrant box called packer_virtualbox-iso_virtualbox.box
, which I then add to Vagrant using
$ vagrant box add BOX_NAME packer_virtualbox-iso_virtualbox.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'BOX_NAME' (v0) for provider:
box: Unpacking necessary files from: file:///packer/packer_virtualbox-iso_virtualbox.box
==> box: Successfully added box 'BOX_NAME' (v0) for 'virtualbox'!
I want to change the value v0
to something else. This is the contents of builder.json
{
"builders": [
{
"type": "virtualbox-iso",
"vm_name": "ion-${ION_BUILD_NUMBER}",
"output_directory": "dist-${ION_BUILD_NUMBER}",
"iso_url": "${ISO_URL}",
"iso_checksum": "${MD5}",
...
}
],
"post-processors": [
"vagrant"
]
}