packer-centos-7 vagrant

Packer Example - CentOS 7 minimal Vagrant Box using Ansible provisioner

Packer Example - CentOS 7 minimal Vagrant Box using Ansible provisioner

Current CentOS Version Used: 7.3

Pre-built Vagrant Box:

This example build configuration installs and configures CentOS 7 x86_64 minimal using Ansible, and then generates two Vagrant box files, for:

  • VirtualBox
  • VMware

The example can be modified to use more Ansible roles, plays, and included playbooks to fully configure (or partially) configure a box file suitable for deployment for development environments.


The following software must be installed/present on your local machine before you can use Packer to build the Vagrant box file:


Make sure all the required software (listed above) is installed, then cd to the directory containing this file, and run:

$ packer build centos7.json

After a few minutes, Packer should tell you the box was generated successfully.

If you want to only build a box for one of the supported virtualization platforms (e.g. only build the VMware box), add --only=vmware-iso to the packer build command:

$ packer build --only=vmware-iso centos7.json

$ packer build --only=virtualbox-iso centos7.json

Testing built boxes

There’s an included Vagrantfile that allows quick testing of the built Vagrant boxes. From this same directory, run one of the following commands after building the boxes:

# For VMware Fusion:
$ vagrant up vmware --provider=vmware_fusion

# For VirtualBox:
$ vagrant up virtualbox --provider=virtualbox


MIT license.

Author Information

Created in 2014 by Jeff Geerling, author of Ansible for DevOps.

Related Repositories



Packer Example - CentOS 7 minimal Vagrant Box using Ansible provisioner ...



CentOS 7 Packer Vagrant Build for PHP7 Development ...



Packer project for building a CentOS 7.x Vagrant Virtualbox. ...



Management of Vagrant box using Packer. Out-Of-The-Box bahmni on CentOS 6.7 ...



Packer configuration for Vagrant and CentOS 7. ...

Top Contributors

geerlingguy rajibmp phrawzty valentin-nasta


-   2.0.0 zip tar
-   1.3.0 zip tar
-   1.2.4 zip tar
-   1.2.0 zip tar
-   1.1.3 zip tar
-   1.1.2 zip tar
-   1.1.1 zip tar
-   1.0.6 zip tar
-   1.0.5 zip tar
-   1.0.4 zip tar
-   1.0.3 zip tar
-   1.0.2 zip tar
-   1.0.1 zip tar
-   1.0.0 zip tar