Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant difference between package and repackage

Tags:

vagrant

What is the difference between vagrant box repackage (docs) and vagrant package (docs)?

I realise that vagrant package works only with the VirtualBox provider, but in case only VirtualBox is used - what's the difference? Maybe there's a specific reason vagrant package was created?

like image 804
Dalius Avatar asked Nov 11 '15 23:11

Dalius


People also ask

What does vagrant box repackage do?

the 'repackage' command creates a distributable box file from the unpacked box in your ~/. vagrant. d/boxes directory.

What is a vagrant package?

Command: vagrant package [name|id]This packages a currently running VirtualBox or Hyper-V environment into a re-usable box. This command can only be used with other providers based on the provider implementation and if the provider supports it.

What is the command to change into vagrant box?

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.


1 Answers

vagrant package

If you have a running VirtualBox VM, you created without vagrant first, did your things using VirtualBox, and you now want to use Vagrant to manage this VM. As vagrant needs box to start VM, you will run vagrant package to create a vagrant box based on the existing VirtualBox VM

vagrant repackage

You will use this option when you have an existing vagrant box installed on your system. So you use vagrant with a given box, again you will make change to the VM and you want to save those changes (software installed ...) as a new box, you will run vagrant repackage on this box, and it will create an updated version of this box so it can be used as starting box for new VM.

like image 79
Frederic Henri Avatar answered Nov 18 '22 07:11

Frederic Henri