vagrant-box
Manage Vagrant boxes
TLDR
List all installed boxes
Add a new box
Add a box from a custom URL
Remove an installed box
Update all boxes that are in use in the current Vagrant environment
Update a specific box
Check if there is a new version available for the box that you are using
Clean up old versions of installed boxes
SYNOPSIS
vagrant box <subcommand> [options]
PARAMETERS
add <name> <url>
Adds a box to Vagrant. <name> is the name you'll use to reference the box, and <url> is the URL (or local path) to the box file.
list
Lists all installed boxes.
remove <name>
Removes the box named <name> from Vagrant.
update
Checks for updates for all installed boxes.
repackage <name> [<provider>]
Repackages the specified box. If provider isn't specified, the provider that the box was added with will be used.
status [<name>]
Shows the status of boxes.
verify [<name>]
Verifies a box by comparing its checksum.
DESCRIPTION
The vagrant box
command allows you to manage Vagrant boxes. Vagrant boxes are pre-packaged operating system environments that are used as the base for creating virtual machines. They contain a base operating system and often include common tools and configurations. This command allows you to add, list, remove, update, and perform other operations related to these boxes.
Boxes provide a consistent and reproducible environment for development, ensuring that everyone on a team is working with the same base system. Using boxes, you can easily create and destroy virtual machines without having to manually configure an operating system each time. Vagrant handles the complexities of downloading and managing boxes, allowing you to focus on the actual development work. They also allow you to work in isolated environments which helps with security.
CAVEATS
Vagrant boxes are typically large files, so downloading them can take a significant amount of time. Make sure you have enough disk space before adding a box.
PROVIDERS
Boxes are often provider-specific. When adding a box, Vagrant automatically detects the provider from the box's metadata. Common providers include VirtualBox, VMware, and Hyper-V. Some operations such as repackage require you to specify the provider.
BOX FORMAT
Vagrant boxes are typically packaged as .box files. These files are essentially archives (like tarballs or zip files) that contain the base operating system image and any necessary configuration files.
BOX VERSIONS
vagrant box update
allows to update boxes. Vagrant manages box versions, allowing you to specify particular versions of boxes within your Vagrantfile. This helps ensure consistency across projects and environments.
HISTORY
The vagrant box
command is a core part of Vagrant. It was introduced with the initial release of Vagrant to provide a mechanism for managing pre-built virtual machine images. Over time, the command has been refined to support different box formats and providers like VirtualBox, VMware, and Hyper-V. The vagrant box
command's development has been closely tied to the evolution of Vagrant, reflecting the need for a simple and consistent way to manage virtual environments.
SEE ALSO
vagrant(1), vagrantfile(5)