This repository contains Packer templates for creating Ubuntu Vagrant boxes written in legacy JSON.
Please see the files under development-environments for published combinations used during the development and testing of patches for this repository.
We no longer provide pre-built binaries for these templates.
We make use of HCL files containing user variables to build specific versions of Ubuntu.
You tell packer
to use a specific user variable file via the -var-file=
command line
option. This will override the default options on the core ubuntu.json
packer template,
which builds Ubuntu 20.04 by default.
The general form for the packer build
command is:
packer build \
[-only=<template-type>] \
[-var-file=ubuntu-add-desktop.pkvars.hcl] \
-var-file=ubuntu{release}.pkvars.hcl \
-var="version={yyyymmdd-n}" \
build-ubuntu
The boxcutter templates currently support the following desktop virtualization (template-type above) strings:
parallels-iso.ubuntu
- Parallels desktop virtualization (Requires the Pro Edition - Desktop edition won't work)virtualbox-iso.ubuntu
- VirtualBox desktop virtualizationvmware-iso.ubuntu
- VMware Fusion or VMware Workstation desktop virtualization
Parallels requires that the Parallels Virtualization SDK for Mac be installed as an additional prerequisite.
If no single template type is specified the builder will attempt to build out all the desktop virtualization products listed above and will fail if those applications have not been installed.
There are two files the define the variables that the user is permitted
(but not enforced) to change at the packer
command-line.
- build-ubuntu/vars-interactive.pkr.hcl
- build-ubuntu/vars-vm-default.pkr.hcl
A third file should be referenced if the virtual machine will require a network proxy.
- build-ubuntu/vars-proxy.pkr.hcl
The only required variable, as noted above, is "version".
The variables representing the primary non-root user and its password are
presently local variables due to the http/user-data
file being a
non-template with those values hard-coded.
The templates respect the following network proxy environment variables and forward them on to the virtual machine environment during the box creation process.
- http_proxy
- https_proxy
- ftp_proxy
- rsync_proxy
- no_proxy
Automated tests are written in Serverspec and require
the vagrant-serverspec
plugin to be installed with:
vagrant plugin install vagrant-serverspec
- Fork and clone the repo.
- Create a new branch, please don't work in your
master
branch directly. - Add new Serverspec or Bats tests in the
test/
subtree for the change you want to make. Runmake test
on a relevant template to see the tests fail (likemake test-virtualbox/ubuntu2004
). - Fix stuff. Use
make ssh
to interactively test your box (likemake ssh-virtualbox/ubuntu2004
). - Run
make test
on a relevant template (likemake test-virtualbox/ubuntu2004
) to see if the tests pass. Repeat steps 3-5 until done. - Update
README.md
andAUTHORS
to reflect any changes. - If you have a large change in mind, it is still preferred that you split them into small commits. Good commit messages are important. The git documentatproject has some nice guidelines on writing descriptive commit messages.
- Push to your fork and submit a pull request.
- Once submitted, a full
make test
run will be performed against your change in the build farm. You will be notified if the test suite fails.
Contact [email protected]
Parallels provided a Business Edition license of their software to run on the basebox build farm.
SmartyStreets provided basebox hosting for the box-cutter project since 2015 - thank you for your support!