» Package

Command: vagrant package [name|id]

This packages a currently running VirtualBox or Hyper-V environment into are-usable box. This command can only be used withother providers based on the provider implementationand if the provider supports it.

» Options

  • —base NAME - Instead of packaging a VirtualBox machine that Vagrantmanages, this will package a VirtualBox machine that VirtualBox manages.NAME should be the name or UUID of the machine from the VirtualBox GUI.Currently this option is only available for VirtualBox.

  • —output NAME - The resulting package will be saved as NAME. By default,it will be saved as package.box.

  • —include x,y,z - Additional files will be packaged with the box. Thesecan be used by a packaged Vagrantfile (documented below) to perform additionaltasks.

  • —vagrantfile FILE - Packages a Vagrantfile with the box, that is loadedas part of the Vagrantfile load orderwhen the resulting box is used.

A common misconception is that the —vagrantfileoption will package a Vagrantfile that is used when vagrant initis used with this box. This is not the case. Instead, a Vagrantfileis loaded and read as part of the Vagrant load process when the box isused. For more information, read about theVagrantfile load order.