Can I rename a Vagrant box?

Solution 1:

You can simply rename the dir that represents the box. If your vagrant files are in their default dir (i.e. /path/to/your/home/.vagrant.d) you can just do:

mv vagrant_path/boxes/box_to_rename vagrant_path/boxes/new_box_name

Also be sure to change the Vagrantfile to use the new label for the box. You just need to change the config.vm.box directive to reflect the changes.

Solution 2:

I would do this:

$ vagrant box repackage misspelled-name
[vagrant] Compressing package to: /Users/johndoe/package.box
$ vagrant box add correct-name /Users/johndoe/package.box
...

Not the worst to know about these two anyway, since you can frequently update base boxes (e.g. to update the kernel, software and guest additions) to avoid running all these required updates every time you vagrant up.