Box

Command: vagrant box

This is the command used to manage (add, remove, etc.) boxes.

The main functionality of this command is exposed via even more subcommands:

Box Add

Command: vagrant box add ADDRESS

This adds a box with the given address to Vagrant. The address can be one of three things:

If an error occurs during the download or the download is interrupted with a Ctrl-C, then Vagrant will attempt to resume the download the next time it is requested. Vagrant will only attempt to resume a download for 24 hours after the initial download.

Options

Options for direct box files

The options below only apply if you are adding a box file directly (when you are not using a catalog).

Checksums for versioned boxes or boxes from HashiCorp's Vagrant Cloud: For boxes from HashiCorp's Vagrant Cloud, the checksums are embedded in the metadata of the box. The metadata itself is served over TLS and its format is validated.

Box List

Command: vagrant box list

This command lists all the boxes that are installed into Vagrant.

Box Outdated

Command: vagrant box outdated

This command tells you whether or not the box you are using in your current Vagrant environment is outdated. If the --global flag is present, every installed box will be checked for updates.

Checking for updates involves refreshing the metadata associated with a box. This generally requires an internet connection.

Options

Box Prune

Command: vagrant box prune

This command removes old versions of installed boxes. If the box is currently in use vagrant will ask for confirmation.

Options

Box Remove

Command: vagrant box remove NAME

This command removes a box from Vagrant that matches the given name.

If a box has multiple providers, the exact provider must be specified with the --provider flag. If a box has multiple versions, you can select what versions to delete with the --box-version flag or remove all versions with the --all flag.

Options

Box Repackage

Command: vagrant box repackage NAME PROVIDER VERSION

This command repackages the given box and puts it in the current directory so you can redistribute it. The name, provider, and version of the box can be retrieved using vagrant box list.

When you add a box, Vagrant unpacks it and stores it internally. The original *.box file is not preserved. This command is useful for reclaiming a *.box file from an installed Vagrant box.

Box Update

Command: vagrant box update

This command updates the box for the current Vagrant environment if there are updates available. The command can also update a specific box (outside of an active Vagrant environment), by specifying the --box flag.

Note that updating the box will not update an already-running Vagrant machine. To reflect the changes in the box, you will have to destroy and bring back up the Vagrant machine.

If you just want to check if there are updates available, use the vagrant box outdated command.

Options

© 2010–2018 Mitchell Hashimoto
Licensed under the MPL 2.0 License.
https://www.vagrantup.com/docs/cli/box.html