Packer templates for building minimal Vagrant baseboxes for multiple platforms
HCL
4,451
1,498 commits
updated Aug 8, 2026
Bento is a project that encapsulates Packer templates for building Vagrant base boxes. A subset of templates are built and published to the bento org on Vagrant Cloud. These published boxes serve as the default boxes for kitchen-vagrant.
*NOTE:
Adding a bento box to Vagrant
vagrant box add bento/ubuntu-18.04
Using a bento box in a Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
end
*1 NOTE: support for these providers is considered experimental and corresponding Vagrant Cloud images may or may not exist.
bento executableTo build a Debian vagrant box using the bento tool with the template available in the os_pkrvars dir, we can use the following command:
bento build os_pkrvars/debian/debian-13-x86_64.pkrvars.hcl
Other available options:
Used to list all builds available for the workstations cpu architecture. This list is also filtered by the build.yml file do_not_build: section. All entries are matched via regex to filter out build templates from the list.
This only shows what would be built with bento build and no template is specified. If any template is specified even if it's in the build.yml to be filtered it'll override the filter.
bento list
If you have successfully built a vagrant box using the bento tool, you should have the vagrant box and a metadata file in the builds/build_complete folder. You can use these files to test the build with a test-kitchen configuration. Run the following command to test the build.
bento test
Test results are written to builds/testing_passed (on success) or builds/testing_failed (on failure). Each provider's result is merged into the metadata file rather than replacing it, so re-running a failed provider after a fix will update only that provider's entry while preserving the results of all other previously tested providers.
To upload boxes in the builds/testing_passed directory to your vagrant cloud account update the build.yml file to specify your account name and which OSs are going to be public.
Make sure you have configured the vagrant cli and logged into your account for the upload command to work.
bento upload
When running bento upload it'll read each <box_name>._metadata.json file and use the data provided to generate the vagrant cloud publish command with the descriptions, version, provider, and checksums all coming from the <box_name>._metadata.json file.
packerTo build a Ubuntu 22.04 box for only the VirtualBox provider
cd <path/to>/bento
packer init -upgrade ./packer_templates
packer build -only=virtualbox-iso.vm -var-file=os_pkrvars/ubuntu/ubuntu-24.04-x86_64.pkrvars.hcl ./packer_templates
To build latest Debian 12 boxes for all possible providers (simultaneously)
cd <path/to>/bento
packer init -upgrade ./packer_templates
packer build -var-file=os_pkrvars/debian/debian-13-x86_64.pkrvars.hcl ./packer_templates
To build latest CentOS 7 boxes for all providers except VMware and Parallels
cd <path/to>/bento
packer init -upgrade ./packer_templates
packer build -except=parallels-iso.vm,vmware-iso.vm -var-file=os_pkrvars/almalinux/almalinux-10-x86_64.pkrvars.hcl ./packer_templates
To use an alternate url
cd <path/to>/bento
packer init -upgrade ./packer_templates
packer build -var 'iso_url=https://mirrors.rit.edu/fedora/fedora/linux/releases/42/Server/x86_64/iso/Fedora-Server-dvd-x86_64-42-1.4.iso' -var-file=os_pkrvars/fedora/fedora-42-x86_64.pkrvars.hcl ./packer_templates
If the build is successful, your box files will be in the builds/build_complete directory at the root of the repository.
You must download the iso image with the Windows drivers for paravirtualized KVM/qemu hardware and place it in the builds/iso/ directory.
You can do this from the command line: mkdir -p builds/iso/; wget -nv -nc https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso -O builds/iso/virtio-win.iso
You can use the following sample command to build a KVM/qemu Windows box:
packer init -upgrade ./packer_templates
packer build --only=qemu.vm -var-file=os_pkrvars/windows/windows-2022-x86_64.pkrvars.hcl ./packer_templates
Templates for operating systems only available via license or subscription are also available in the repository, these include but are not limited to: Red Hat Enterprise Linux, and SUSE Linux Enterprise. As the ISOs are not publicly available the URL values will need to be overridden as appropriate. We rely on the efforts of those with access to licensed versions of the operating systems to keep these up-to-date.
Most of the providers expect unrestricted access to networking in order to build as expected. We can't enumerate all possible firewall configurations but include some snippets below that might be useful to users.
$VS = "Standardswitch"
$IF_ALIAS = (Get-NetAdapter -Name "vEthernet ($VS)").ifAlias
New-NetFirewallRule -Displayname "Allow incoming from $VS" -Direction Inbound -InterfaceAlias $IF_ALIAS -Action Allow
Hyper-V Gen 2 VMs do not support floppy drives. If you previously provided resources using a floppy drive, you must add those files to your Gen 2 iso images, in particular:
autounattend.xml: The Gen 2 autounattend.xml file supports EFI partitions. Update the autounattend.xml with the correct Windows version for your systems and ensure that the partitions are correct for your situation. You also need to manage the driver disk that holds the hyper-v guest services drivers and adjust the autounattend.xml file as appropriate.Please use GitHub issues to report bugs, features, or other problems.
A huge thank you to these related projects from which we've taken inspiration and often used as a source for workarounds in complex world of base box building.
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!
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.
See COPYRIGHT.md.
(top 24 of 32)
693 followers · starred Sep 2016
449 followers · starred Jan 2014
1,058 followers · starred Apr 2014
105 followers · starred Jan 2014
Packer templates for building minimal Vagrant baseboxes for multiple platforms
HCL
4,451
1,498 commits
updated Aug 8, 2026
Bento is a project that encapsulates Packer templates for building Vagrant base boxes. A subset of templates are built and published to the bento org on Vagrant Cloud. These published boxes serve as the default boxes for kitchen-vagrant.
*NOTE:
Adding a bento box to Vagrant
vagrant box add bento/ubuntu-18.04
Using a bento box in a Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
end
*1 NOTE: support for these providers is considered experimental and corresponding Vagrant Cloud images may or may not exist.
bento executableTo build a Debian vagrant box using the bento tool with the template available in the os_pkrvars dir, we can use the following command:
bento build os_pkrvars/debian/debian-13-x86_64.pkrvars.hcl
Other available options:
Used to list all builds available for the workstations cpu architecture. This list is also filtered by the build.yml file do_not_build: section. All entries are matched via regex to filter out build templates from the list.
This only shows what would be built with bento build and no template is specified. If any template is specified even if it's in the build.yml to be filtered it'll override the filter.
bento list
If you have successfully built a vagrant box using the bento tool, you should have the vagrant box and a metadata file in the builds/build_complete folder. You can use these files to test the build with a test-kitchen configuration. Run the following command to test the build.
bento test
Test results are written to builds/testing_passed (on success) or builds/testing_failed (on failure). Each provider's result is merged into the metadata file rather than replacing it, so re-running a failed provider after a fix will update only that provider's entry while preserving the results of all other previously tested providers.
To upload boxes in the builds/testing_passed directory to your vagrant cloud account update the build.yml file to specify your account name and which OSs are going to be public.
Make sure you have configured the vagrant cli and logged into your account for the upload command to work.
bento upload
When running bento upload it'll read each <box_name>._metadata.json file and use the data provided to generate the vagrant cloud publish command with the descriptions, version, provider, and checksums all coming from the <box_name>._metadata.json file.
packerTo build a Ubuntu 22.04 box for only the VirtualBox provider
cd <path/to>/bento
packer init -upgrade ./packer_templates
packer build -only=virtualbox-iso.vm -var-file=os_pkrvars/ubuntu/ubuntu-24.04-x86_64.pkrvars.hcl ./packer_templates
To build latest Debian 12 boxes for all possible providers (simultaneously)
cd <path/to>/bento
packer init -upgrade ./packer_templates
packer build -var-file=os_pkrvars/debian/debian-13-x86_64.pkrvars.hcl ./packer_templates
To build latest CentOS 7 boxes for all providers except VMware and Parallels
cd <path/to>/bento
packer init -upgrade ./packer_templates
packer build -except=parallels-iso.vm,vmware-iso.vm -var-file=os_pkrvars/almalinux/almalinux-10-x86_64.pkrvars.hcl ./packer_templates
To use an alternate url
cd <path/to>/bento
packer init -upgrade ./packer_templates
packer build -var 'iso_url=https://mirrors.rit.edu/fedora/fedora/linux/releases/42/Server/x86_64/iso/Fedora-Server-dvd-x86_64-42-1.4.iso' -var-file=os_pkrvars/fedora/fedora-42-x86_64.pkrvars.hcl ./packer_templates
If the build is successful, your box files will be in the builds/build_complete directory at the root of the repository.
You must download the iso image with the Windows drivers for paravirtualized KVM/qemu hardware and place it in the builds/iso/ directory.
You can do this from the command line: mkdir -p builds/iso/; wget -nv -nc https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso -O builds/iso/virtio-win.iso
You can use the following sample command to build a KVM/qemu Windows box:
packer init -upgrade ./packer_templates
packer build --only=qemu.vm -var-file=os_pkrvars/windows/windows-2022-x86_64.pkrvars.hcl ./packer_templates
Templates for operating systems only available via license or subscription are also available in the repository, these include but are not limited to: Red Hat Enterprise Linux, and SUSE Linux Enterprise. As the ISOs are not publicly available the URL values will need to be overridden as appropriate. We rely on the efforts of those with access to licensed versions of the operating systems to keep these up-to-date.
Most of the providers expect unrestricted access to networking in order to build as expected. We can't enumerate all possible firewall configurations but include some snippets below that might be useful to users.
$VS = "Standardswitch"
$IF_ALIAS = (Get-NetAdapter -Name "vEthernet ($VS)").ifAlias
New-NetFirewallRule -Displayname "Allow incoming from $VS" -Direction Inbound -InterfaceAlias $IF_ALIAS -Action Allow
Hyper-V Gen 2 VMs do not support floppy drives. If you previously provided resources using a floppy drive, you must add those files to your Gen 2 iso images, in particular:
autounattend.xml: The Gen 2 autounattend.xml file supports EFI partitions. Update the autounattend.xml with the correct Windows version for your systems and ensure that the partitions are correct for your situation. You also need to manage the driver disk that holds the hyper-v guest services drivers and adjust the autounattend.xml file as appropriate.Please use GitHub issues to report bugs, features, or other problems.
A huge thank you to these related projects from which we've taken inspiration and often used as a source for workarounds in complex world of base box building.
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!
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.
See COPYRIGHT.md.
(top 24 of 32)
693 followers · starred Sep 2016
449 followers · starred Jan 2014
1,058 followers · starred Apr 2014
105 followers · starred Jan 2014