I tried to rename vagrant box, but there’s no command to it. So I seaerched a way to rename it.

Box directory

Boxes are stored in $HOME/.vagrant.d/boxes by default. We can change the place to store boxes by changing the environment variable VAGRANT_HOME. Visit the link below for further detail.

> vagrant box list
centos/6 (virtualbox, 1803.01)

> ll $HOME/.vagrant.d/boxes
total 0
drwxr-xr-x   3 user  staff   96 May  2 08:20 .
drwxr-xr-x  10 user  staff  320 May 26 18:47 ..
drwxr-xr-x   4 user  staff  128 May  2 08:20 centos-VAGRANTSLASH-6


So, we just need to rename folers under the folder. / is replaced with VAGRANTSLASH, so be careful when use that character.

> mv $HOME/.vagrant.d/boxes/centos-VAGRANTSLASH-6 $HOME/.vagrant.d/boxes/centos-VAGRANTSLASH-7

> vagrant box list
centos/7 (virtualbox, 1803.01)