Create a Vagrant image file and share on VagrantCloud

Here we will cover how to create a Vagrant Box. In this case I want to install chef-solo over an Ubuntu/trusty image. You can clone all work in this post from this repo

mkdir trusty64-chef
cd trusty64-chef/
rbenv local 2.1.2
gem install bundle

Create Gemfile:

source ''
gem 'vagrant', github: 'mitchellh/vagrant', tag: 'v1.6.4'
gem 'knife-solo'

Install gems:

bundle install --binstubs .bundle/bin

Create Vagrantfile: ‘vagrant init’. In order to take access to the image, add to Vagrantfile: :public_network, bridge: "wlan0", ip: ""

Start box: ‘vagrant up’. Install Chef in the image:

knife solo prepare vagrant@ ## password: vagrant

Update Ubuntu:

vagrant ssh
sudo apt-get update

Package the Box: `vagrant package –base trusty64-chef_default_1409751631640_92694 –output`

Add to local Box list: `vagrant box add lebrijo/trusty64-chef`

Upload the box to a HTTP server: `scp`

Create an account and entry in [lebrijo/trusty64-chef](

Leave a Reply

Your email address will not be published. Required fields are marked *