Packer templates for building minimal Vagrant baseboxes
Shell Ruby PowerShell Other
Latest commit 11c5e3a Aug 3, 2016 @cheeseplus cheeseplus committed on GitHub Merge pull request #644 from chef/release-check
Check to see if release has already taken place
Failed to load latest commit information.
archive Fedora 22 EOL Jul 22, 2016
bin Check to see if release has already taken place and skip if not needed Aug 3, 2016
builds Remove subdirectories under `build/` as they are no longer used. Jun 27, 2015
floppy Sudo path changed Feb 3, 2016
http Removed unneccesary firewall config Aug 2, 2016
scripts I regret to inform you that this is in fact the fix Jul 28, 2016
vagrantfile_templates removing internal network Oct 2, 2015
.gitattributes Force CRLF on Autounattend files for Windows Feb 23, 2014
.gitignore Ignore .kitchen.VIRT.yml files Apr 25, 2016
.kitchen.yml.erb The power of ERB compels you Jul 9, 2016
.travis.yml Update the packer download URL and use 0.9.0 Feb 27, 2016
CHANGELOG.md Release 2.2.9 Aug 1, 2016
Gemfile Updating Gemfile May 20, 2016
LICENSE [OC-1013] - move definitions from basebox project Jul 16, 2012
MAINTAINERS.md https everywhere Mar 14, 2016
NOTICE.md Opscode -> Chefs and other minor stuff Aug 7, 2015
OLD-BOXES.md Updated README with CentOS 7.1 boxes Apr 4, 2015
README.md Didn't use 5.1 because #problems Jul 26, 2016
Rakefile Move all the logic out of Rakefile and into bin/bento May 20, 2016
Thorfile Update Thorfile to run Packer commands in root of project. May 20, 2015
bootstrap.sh The power of ERB compels you Jul 9, 2016
build.sh Move all the logic out of Rakefile and into bin/bento May 20, 2016
buildkite.rb First stab at a buildkite script. Jul 9, 2015
centos-5.11-i386.json Added "disk_size" user variable May 13, 2016
centos-5.11-x86_64.json Added "disk_size" user variable May 13, 2016
centos-6.8-i386.json Updated CentOS and RHEL to 6.8 May 27, 2016
centos-6.8-x86_64.json Updated CentOS and RHEL to 6.8 May 27, 2016
centos-7.2-x86_64.json Added "disk_size" user variable May 13, 2016
debian-7.11-amd64.json Updated Debian 7 to 7.11 Jun 7, 2016
debian-7.11-i386.json Updated Debian 7 to 7.11 Jun 7, 2016
debian-8.5-amd64.json Updated Debian 8 to 8.5 Jun 7, 2016
debian-8.5-i386.json Updated Debian 8 to 8.5 Jun 7, 2016
fedora-23-i386.json Add Fedora 24 and dedupe kickstart scripts Jul 14, 2016
fedora-23-x86_64.json Add Fedora 24 and dedupe kickstart scripts Jul 14, 2016
fedora-24-i386.json Add Fedora 24 and dedupe kickstart scripts Jul 14, 2016
fedora-24-x86_64.json Add Fedora 24 and dedupe kickstart scripts Jul 14, 2016
freebsd-10.3-amd64.json FreeBSD: Properly set roots password. Jun 13, 2016
freebsd-10.3-i386.json FreeBSD: Properly set roots password. Jun 13, 2016
freebsd-9.3-amd64.json FreeBSD: Properly set roots password. Jun 13, 2016
freebsd-9.3-i386.json FreeBSD: Properly set roots password. Jun 13, 2016
macosx-10.10.json Added "disk_size" user variable May 13, 2016
macosx-10.11.json Added "disk_size" user variable May 13, 2016
macosx-10.7.json Added "disk_size" user variable May 13, 2016
macosx-10.8.json Added "disk_size" user variable May 13, 2016
macosx-10.9.json Added "disk_size" user variable May 13, 2016
omnios-r151014.json Added "disk_size" user variable May 13, 2016
omnios-r151018.json Added "disk_size" user variable May 13, 2016
opensuse-13.2-i386.json Added "disk_size" user variable May 13, 2016
opensuse-13.2-x86_64.json Added "disk_size" user variable May 13, 2016
opensuse-leap-42.1-x86_64.json OpenSUSE Leap 42.1: requires 768 Mb memory. Jul 26, 2016
oracle-5.11-i386.json Added "disk_size" user variable May 13, 2016
oracle-5.11-x86_64.json Added "disk_size" user variable May 13, 2016
oracle-6.7-i386.json Added "disk_size" user variable May 13, 2016
oracle-6.7-x86_64.json Added "disk_size" user variable May 13, 2016
oracle-7.2-x86_64.json Added "disk_size" user variable May 13, 2016
rhel-5.11-i386.json Added "disk_size" user variable May 13, 2016
rhel-5.11-x86_64.json Added "disk_size" user variable May 13, 2016
rhel-6.8-i386.json Updated CentOS and RHEL to 6.8 May 27, 2016
rhel-6.8-x86_64.json Updated CentOS and RHEL to 6.8 May 27, 2016
rhel-7.2-x86_64.json Added "disk_size" user variable May 13, 2016
sles-12-sp1-x86_64.json Add script for sles-12-sp1 Aug 2, 2016
sles-12-x86_64.json Added "disk_size" user variable May 13, 2016
solaris-10.11-x86.json Added "disk_size" user variable May 13, 2016
solaris-11-x86.json Fix vagrant.sh failing on Solaris nodes Jun 2, 2016
ubuntu-12.04-amd64.json Added "disk_size" user variable May 13, 2016
ubuntu-12.04-i386.json Added "disk_size" user variable May 13, 2016
ubuntu-14.04-amd64.json Added "disk_size" user variable May 13, 2016
ubuntu-14.04-i386.json Added "disk_size" user variable May 13, 2016
ubuntu-15.10-amd64.json Added "disk_size" user variable May 13, 2016
ubuntu-15.10-i386.json Added "disk_size" user variable May 13, 2016
ubuntu-16.04-amd64.json Update for 16.04.1 iso Jul 24, 2016
ubuntu-16.04-i386.json Update for 16.04.1 iso Jul 24, 2016
windows-nano-tp3.json Added "disk_size" user variable May 13, 2016

README.md

Bento

Build Status

Bento is a project that encapsulates Packer templates for building Vagrant base boxes. We use these boxes internally at Chef Software, Inc. for testing Hosted Chef, Chef Server and our open source cookbooks via test-kitchen.

This project is managed by the CHEF Release Engineering team. For more information on the Release Engineering team's contribution, triage, and release process, please consult the CHEF Release Engineering OSS Management Guide.

Pre-built Boxes

The following boxes are built from this repository's templates for publicly available platforms and are currently hosted via Atlas in the bento organization.

64 bit

VirtualBox VMware Parallels
centos-5.11 x86_64 x86_64 x86_64
centos-6.8 x86_64 x86_64 x86_64
centos-7.2 x86_64 x86_64 x86_64
debian-7.11 amd64 amd64 amd64
debian-8.5 amd64 amd64 amd64
fedora-23 x86_64 x86_64 x86_64
fedora-24 x86_64 x86_64 x86_64
freebsd-9.3 amd64 amd64 amd64
freebsd-10.3 amd64 amd64 amd64
opensuse-13.2 x86_64 x86_64 x86_64
ubuntu-12.04 amd64 amd64 amd64
ubuntu-14.04 amd64 amd64 amd64
ubuntu-15.10 amd64 amd64 amd64
ubuntu-16.04 amd64 amd64 amd64

32 bit

VirtualBox VMware Parallels
centos-5.11 i386 i386 i386
centos-6.8 i386 i386 i386
debian-7.11 i386 i386 i386
debian-8.5 i386 i386 i386
opensuse-13.2 i386 i386 i386
ubuntu-12.04 i386 i386 i386
ubuntu-14.04 i386 i386 i386
ubuntu-15.10 i386 i386 i386
ubuntu-16.04 i386 i386 i386

NOTE This table tracks only the latest release for a given version. Boxes may exist in Atlas or S3 but are not guaranteed to be updated at this time.

Build Notes

  • If you're using the Vagrant VMWare Fusion provider, using vagrant box add --provider vmware_desktop ... will work for these boxes. Using --provider vmware_fusion, will not.
  • The boxes are currently hosted on both Atlas and Amazon S3 to maintain backward compatibility with test-kitchen. Once test-kitchen changes defaults the S3 buckets will no longer be updated.
  • Tooling versions
    • Packer: 0.10.1
    • VirtualBox: 5.0.26
    • VMware Fusion: 8.1.1
    • Parallels: 11.2.0

VMWare Fusion 8, Packer, systemd

Recent Linux distributions use systemd's logic to predictably name network devices. In our scenario, this is tied to the PCI slot id. For unknown reasons, boxes built with the default vmx config provided by packer use a different PCI slot id (32 instead of 33) once they got imported to VMWare Fusion 8, which results in a different device name and finally in broken networking. This issue is documented in the following places:

As a workaround we've started to provide the changed PCI slot id as a custom value with the packer definitions with Ubuntu 15.10+ and Debian 8+. However this is not yet tested, may not solve the issue and/or break compatibility with other VMWare products/versions!

Older Boxes

Older boxes include Chef and therefore are not compatible with some new plugins. The full list of old boxes are available in the old boxes file.

Using Pre-built Boxes

Adding a bento box to vagrant:

$ vagrant box add bento/debian-8.5

Using a bento box in a Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "bento/debian-8.5"
end

Requirements

  • Packer
  • At least one virtualization provider: Virtualbox, VMware Fusion, Parallels Desktop, etc

Build Your Own Bento Boxes

Using bento

In the bin directory of this repo is the bento utility which wraps packer as well as allowing other related functionality. This is an opinionated tool that the project uses for building the hosted boxes listed above.

To build multiple templates for all providers (VirtualBox, Fusion, Parallels, etc):

$ bin/bento build debian-8.5-amd64 debian-8.5-i386

To build a box for a single provider:

$ bin/bento build --only=virtualbox-iso debian-8.5-amd64

Using packer

Templates can still be built directly by packer

To build a template for all providers (VirtualBox, Fusion, Parallels):

$ packer build debian-8.5-amd64.json

To build a template only for a list of specific providers:

$ packer build -only=virtualbox-iso debian-8.5-amd64.json

To build a template for all providers except a list of specific providers:

$ packer build -except=parallels-iso,vmware-iso debian-8.5-amd64.json

If you want to use a another mirror site, use the mirror user variable.

$ packer build -var 'mirror=http://ftp.jaist.ac.jp/pub/Linux/debian-cdimage/release' debian-8.5-amd64.json

Congratulations! You now have box(es) in the ../builds directory that you can then add to Vagrant and start testing cookbooks.

Notes:

  • The box_basename can be overridden like other Packer vars with -var 'box_basename=debian-8.5'

Proprietary Boxes

Mac OS X, Red Hat Enterprise Linux, and SUSE Linux Enterprise Server templates are provided. However, their ISOs are not publicly retrievable and as such, the URLs in those templates are bogus. For RHEL and SLES, substitute a server where the ISOs are hosted, using the mirror variable as above.

Mac OS X

To build a Mac OS X box, you will need to start with an installer for your desired version of OS X. You will then need to use Tim Sutton's osx-vm-templates/) to modify that installer for use by packer. The output of that build will include the location of the ISO and its checksum, which you can substitute into your packer build command, e.g.:

$ packer build -var 'iso_checksum=<checksum>' -var 'iso_url=<iso_url>' macosx-10.11.json

There is a known issue where test-kitchen starts a Mac OS X box correctly, but vagrant up fails due to the absence of the HGFS kernel module. This is due to a silent failure during the VMware tools installation and can be corrected by installing the VMware tools on the Mac OS X box manually.

Note that, while it is possible to build OS X boxes for VirtualBox, it may not be ideal. VirtualBox provides no "guest additions" for OS X. Boxes consequently have limited networking configurability and must rely on rsync for folder syncing. VMWare, when available, is generally preferred.

Windows

Currently the project does not include any definitions for building Windows boxes. For other approaches to building Windows boxes, please see the following community projects:

Special Note About Building from Windows Hosts

When building boxes from a Windows host system, you must ensure that kickstart configuration files (ks.cfg for RHEL based systems) and preseed files (preseed.cfg for Debian based systems) have Unix line endings (i.e. lines end with LF character only). Moreover, it's also a good idea to have *.sh scripts with Unix line endings too.

When these files have Windows line endings, the group creation can fail in the pre-seed phase and in turn, prevents the user vagrant to be created correctly. This ultimately results in Packer not being able to connect to the newly booted up machine with an error message that looks like this:

==> virtualbox-iso: Waiting for SSH to become available...
==> virtualbox-iso: Error waiting for SSH: handshake failed: ssh: unable to authenticate, attempted methods [none password], no support

Since Packer tries to log in with user vagrant but it was not created successfully in the pre-seed phase, it is unable to connect to the machine and the packaging process stops.

By default, when cloning this repository, git should normalize ks.cfg, preseed.cfg and *.sh to Unix line endings and *.bat to Windows line endings, thanks to the .gitattributes file in the repository. However, if it's not the case because you have overridden line-ending conversion in your own git configuration, convert the offending files so they have the correct line endings.

Bugs and Issues

Please use GitHub issues to report bugs, features, or other problems.

License & Authors

These basebox templates were converted from veewee definitions originally based on work done by Tim Dysinger to make "Don't Repeat Yourself" (DRY) modular baseboxes. Thanks Tim!

Mac OS X templates were adopted wholesale from Fletcher Nichol's packer templates.

Copyright 2012-2016, Chef Software, Inc. (<legal@chef.io>)
Copyright 2011-2012, Tim Dysinger (<tim@dysinger.net>)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.