Vagrant Base Box

Builder type: vagrant Require Cloud Account: No

The Vagrant builder provides information for building Vagrant base-box machine images. The Vagrant builder section has the following definition:

{
  "builders": [
    {
      "type": "vagrant",
      ...the rest of the definition goes here.
    }
  ]
}

Building a Machine Image

For building an image, the valid keys are:

  • hardwareSettings (mandatory): an object providing hardware settings to be used for the machine image. The following valid keys for hardware settings are:
    • memory (mandatory): an integer providing the amount of RAM to provide to an instance provisioned from the machine image (in MB).
  • installation (optional): an object providing low-level installation or first boot options. These override any installation options in the Stack section. The following valid keys for installation are:
    • diskSize (mandatory): an integer providing the disk size of the machine image to create. Note, this overrides any disk size information in the stack. This cannot be used if an advanced partitioning table is defined in the stack.
  • osUser (optional): a string providing the user used to authenticate to the vagrant base box. This is mandatory if the base box is private, otherwise this value is ignored and the user vagrant is used.
  • publicBaseBox (optional): a boolean determining if the base box to be created is a public base box or not. When public, the os user is vagrant and uses the public (insecure) public key as described in the vagrant documentation
  • sshKey (optional): an object providing the public SSH key information to add to the base box. The object contains:
    • name (mandatory): a string providing the name of the public ssh key
    • publicKey (mandatory): a string providing the public ssh key. A public key must begin with string ssh-rsa or ssh-dss. This is mandatory if the base box is private, otherwise this value is ignored and the default public ssh key is used.
  • type (mandatory): the builder type: vagrant

Note

You can get copies of the SSH keypairs for public base boxes here.

Examples

Basic Example: Public Base Box

The following example shows a Vagrant builder creating a public base box.

{
  "builders": [
    {
      "type": "vagrant",
      "hardwareSettings": {
        "memory": 1024
      },
      "publicBaseBox": true
    }
  ]
}

Private Base Box Example

The following example shows a Vagrant builder for a private base box (note, that the values used is the same for building a public base box)

{
  "builders": [
    {
      "type": "vagrant",
      "hardwareSettings": {
        "memory": 1024
      },
      "publicBaseBox": false,
      "osUser": "vagrant",
      "sshKey": {
        "name": "myVagrantPublicKey",
        "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"
      }
    }
  ]
}