{"id":13448436,"url":"https://github.com/chef/bento","last_synced_at":"2025-12-18T05:45:27.748Z","repository":{"id":2660108,"uuid":"3651143","full_name":"chef/bento","owner":"chef","description":"Packer templates for building minimal Vagrant baseboxes for multiple platforms","archived":false,"fork":false,"pushed_at":"2025-04-17T04:02:41.000Z","size":3165,"stargazers_count":4297,"open_issues_count":13,"forks_count":1126,"subscribers_count":193,"default_branch":"main","last_synced_at":"2025-04-17T18:16:44.105Z","etag":null,"topics":["amazon","centos","freebsd","linux","macos","oracle","packer","packer-templates","parallels","redhat","rhel","ubuntu","vagrant","virtualbox","vmware","vmware-fusion","vmware-workstation","windows"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chef.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-03-07T16:35:05.000Z","updated_at":"2025-04-17T04:02:46.000Z","dependencies_parsed_at":"2023-07-05T18:02:17.718Z","dependency_job_id":"e3fc6774-f82d-43e1-a6a3-6417cb5f7d54","html_url":"https://github.com/chef/bento","commit_stats":{"total_commits":1605,"total_committers":239,"mean_commits":"6.7154811715481175","dds":0.7794392523364486,"last_synced_commit":"9f6671c4d78dfead41c6a5a59377d0da09a8b121"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fbento","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fbento/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fbento/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fbento/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chef","download_url":"https://codeload.github.com/chef/bento/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514154,"owners_count":21443204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","centos","freebsd","linux","macos","oracle","packer","packer-templates","parallels","redhat","rhel","ubuntu","vagrant","virtualbox","vmware","vmware-fusion","vmware-workstation","windows"],"created_at":"2024-07-31T05:01:45.536Z","updated_at":"2025-12-18T05:45:27.679Z","avatar_url":"https://github.com/chef.png","language":"HCL","readme":"# Bento\n\nBento is a project that encapsulates [Packer](https://www.packer.io/) templates for building [Vagrant](https://www.vagrantup.com/) base boxes. A subset of templates are built and published to the [bento org](https://app.vagrantup.com/bento) on Vagrant Cloud. These published boxes serve as the default boxes for [kitchen-vagrant](https://github.com/test-kitchen/kitchen-vagrant/).\n\n***NOTE:**\n\n- Vagrant 2.4.0+ is required for new cpu architecture support\n- For `bento test` command to work test-kitchen and kitchen-vagrant gems must be installed\n- Virutalbox 7.1.6+ required for arm64 support\n- When running packer build command the output directory is relative to the working directory the command is currently running in. Suggest running packer build commands from bento root directory for build working files to be placed in bento/builds/(build_name) directory by default. If the output_directory variable isn't overwritten a directory called builds/(build_name) will be created in the current working directory that you are running the command from\n\n## Using Public Boxes\n\nAdding a bento box to Vagrant\n\n```bash\nvagrant box add bento/ubuntu-18.04\n```\n\nUsing a bento box in a Vagrantfile\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"bento/ubuntu-18.04\"\nend\n```\n\n### Installing Bento\n\n1. install ruby environment\n1. clone repo\n1. cd \u003cpath/to\u003e/bento\n1. gem build bento.gemspec\n1. gem install bento-*.gem\n\n### Building Boxes\n\n#### Requirements\n\n- [Packer](https://www.packer.io/) \u003e= 1.7.0\n- [Vagrant](https://www.vagrantup.com/) \u003e= 2.4.0\n- At least one of the following virtualization providers:\n   - [VirtualBox](https://www.virtualbox.org/)\n   - [VMware Fusion](https://www.vmware.com/products/fusion.html)\n   - [VMware Workstation](https://www.vmware.com/products/workstation-pro.html)\n   - [Parallels Desktop Pro](https://www.parallels.com/products/desktop/)\n   - [qemu](https://www.qemu.org/) *1\n   - [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/) *1\n\n*1 **NOTE:** support for these providers is considered experimental and corresponding Vagrant Cloud images may or may not exist.\n\n### Using `bento` executable\n\n#### build\n\nTo build a Debian vagrant box using the bento tool with the template available in the `os_pkrvars` dir, we can use the following command:\n\n```bash\nbento build --cpus 2 os_pkrvars/debian/debian-12-x86_64.pkrvars.hcl\n```\n\nOther available options:\n\n- cpus - Specify the number of CPUs needed in the new build\n- mem - Specify the memory\n- config - Use a configuration file other than default builds.yml\n- on-error - Choose what to do if a build fails\n- vars - Comma seperated list of variable names equal values (ex: boot_wait=\"2s\",ssh_timeout=\"5s\")\n- var_files - Comma seperated list of pkrvar.hcl files to include in the builds (ex: /path/to/var_file.pkrvars.hcl,/path/to/next/var_file2.pkrvars.hcl)\n- metadata_only - Only generate the metadata json file\n- mirror - The template will have a default mirror link, if you wish to use an alternative one, you can utilise this configuration\n- dry-run - This will not create any build, but will create a metadata file for reference\n- only - Only build some Packer builds (Default: parallels-iso.vm,virtualbox-iso.vm,vmware-iso.vm\n- except - Build all Packer builds except these (ex: parallels-iso.vm,virtualbox-iso.vm,vmware-iso.vm)\n- debug - Print the debug logs\n- gui - Packer will be building VirtualBox virtual machines by launching a GUI that shows the console of the machine being built. This option is false by default\n- single - This can be used to disable the parallel builds\n\n#### list\n\nUsed 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.\n\nThis 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.\n\n```bash\nbento list\n```\n\n#### test\n\nIf you have successfully built a vagrant box using the bento tool, you should have the vagrant box and a metadata file in the `builds` folder. You can use these files to test the build with a test-kitchen configuration. Run the following command to test the build.\n\n```bash\nbento test\n```\n\n#### upload\n\nTo upload boxes in the builds directory to your vagrant cloud account update the build.yml file to specify your account name and which OSs are going to be public.\n\nMake sure you have configured the vagrant cli and logged into your account for the upload command to work.\n\n```bash\nbento upload\n```\n\nWhen running `bento upload` it'll read each \u003cbox_name\u003e._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 \u003cbox_name\u003e._metadata.json file.\n\n### Using `packer`\n\nTo build a Ubuntu 22.04 box for only the VirtualBox provider\n\n```bash\ncd \u003cpath/to\u003e/bento\npacker init -upgrade ./packer_templates\npacker build -only=virtualbox-iso.vm -var-file=os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl ./packer_templates\n```\n\nTo build latest Debian 12 boxes for all possible providers (simultaneously)\n\n```bash\ncd \u003cpath/to\u003e/bento\npacker init -upgrade ./packer_templates\npacker build -var-file=os_pkrvars/debian/debian-12-x86_64.pkrvars.hcl ./packer_templates\n```\n\nTo build latest CentOS 7 boxes for all providers except VMware and Parallels\n\n```bash\ncd \u003cpath/to\u003e/bento\npacker init -upgrade ./packer_templates\npacker build -except=parallels-iso.vm,vmware-iso.vm -var-file=os_pkrvars/centos/centos-7-x86_64.pkrvars.hcl ./packer_templates\n```\n\nTo use an alternate url\n\n````bash\ncd \u003cpath/to\u003e/bento\npacker init -upgrade ./packer_templates\npacker build -var 'iso_url=https://mirrors.rit.edu/fedora/fedora/linux/releases/41/Server/x86_64/iso/Fedora-Server-dvd-x86_64-41-1.4.iso' -var-file=os_pkrvars/fedora/fedora-41-x86_64.pkrvars.hcl ./packer_templates\n````\n\nIf the build is successful, your box files will be in the `builds` directory at the root of the repository.\n\n### KVM/qemu support for Windows\n\nYou must download [the iso image with the Windows drivers for paravirtualized KVM/qemu hardware](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso) and place it in the builds/iso/ directory.\nYou 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`\n\nYou can use the following sample command to build a KVM/qemu Windows box:\n\n```bash\npacker init -upgrade ./packer_templates\npacker build --only=qemu.vm -var-file=os_pkrvars/windows/windows-2022-x86_64.pkrvars.hcl ./packer_templates\n```\n\n### Proprietary Templates\n\nTemplates 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.\n\n### Networking/Firewalls\n\nMost 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.\n\n### Windows\n\n```powershell\n$VS = \"Standardswitch\"\n$IF_ALIAS = (Get-NetAdapter -Name \"vEthernet ($VS)\").ifAlias\nNew-NetFirewallRule -Displayname \"Allow incomming from $VS\" -Direction Inbound -InterfaceAlias $IF_ALIAS -Action Allow\n```\n\n#### Hyper-V Generation 2 VM's\n\nHyper-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:\n\n- `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.\n\n### Bugs and Issues\n\nPlease use GitHub issues to report bugs, features, or other problems.\n\n## Related projects\n\nA 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.\n\n- \u003chttps://github.com/boxcutter\u003e\n- \u003chttps://github.com/lavabit/robox\u003e\n- \u003chttps://github.com/mcandre/packer-templates\u003e\n- \u003chttps://github.com/timsutton/osx-vm-templates\u003e\n- \u003chttps://github.com/ferventcoder/vagrant-windows-puppet/tree/master/baseboxes\u003e\n\n## License \u0026 Authors\n\nThese basebox templates were converted from [veewee](https://github.com/jedi4ever/veewee) definitions originally based on [work done by Tim Dysinger](https://github.com/dysinger) to make \"Don't Repeat Yourself\" (DRY) modular baseboxes. Thanks Tim!\n\n- Author: Chris McClimans ([chris@hippiehacker.org](mailto:chris@hippiehacker.org))\n- Author: Fletcher Nichol ([fnichol@nichol.ca](mailto:fnichol@nichol.ca))\n- Author: Joshua Timberman ([joshua@chef.io](mailto:joshua@chef.io))\n- Author: Julian Dunn ([jdunn@chef.io](mailto:jdunn@chef.io))\n- Author: Ross Timson ([ross@rosstimson.com](mailto:ross@rosstimson.com))\n- Author: Seth Chisamore ([schisamo@chef.io](mailto:schisamo@chef.io))\n- Author: Stephen Delano ([stephen@chef.io](mailto:stephen@chef.io))\n- Author: Tim Dysinger ([tim@dysinger.net](mailto:tim@dysinger.net))\n- Author: Tim Smith ([tsmith@chef.io](mailto:tsmith@chef.io))\n- Author: Tom Duffield ([tom@chef.io](mailto:tom@chef.io))\n- Author: Corey Hemminger ([corey.hemminger@progress.com](mailto:corey.hemminger@progress.com))\n\n```text\nCopyright 2012-2024, Progress Software, Inc. (\u003clegal@chef.io\u003e)\nCopyright 2011-2012, Tim Dysinger (\u003ctim@dysinger.net\u003e)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":["Shell","HCL","Local Testing","Boxes","Rust程序设计","Virtualization"],"sub_categories":["资源传输下载","Containers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchef%2Fbento","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchef%2Fbento","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchef%2Fbento/lists"}