2013-09-03 18:08:28 +00:00
|
|
|
---
|
2016-01-19 18:08:53 +00:00
|
|
|
layout: "docs"
|
2013-09-06 16:50:43 +00:00
|
|
|
page_title: "vagrant package - Command-Line Interface"
|
2013-09-03 18:08:28 +00:00
|
|
|
sidebar_current: "cli-package"
|
2016-01-19 18:08:53 +00:00
|
|
|
description: |-
|
|
|
|
The "vagrant package" command is used to package a currently-running
|
2016-12-08 20:21:55 +00:00
|
|
|
VirtualBox or Hyper-V vagrant environment into a reusable Vagrant box.
|
2013-09-03 18:08:28 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Package
|
|
|
|
|
2016-04-12 11:45:10 +00:00
|
|
|
**Command: `vagrant package [name|id]`**
|
2013-09-03 18:08:28 +00:00
|
|
|
|
2016-12-08 20:21:55 +00:00
|
|
|
This packages a currently running _VirtualBox_ or _Hyper-V_ environment into a
|
2016-01-19 18:08:53 +00:00
|
|
|
re-usable [box](/docs/boxes.html). This command can only be used with
|
|
|
|
other [providers](/docs/providers/) based on the provider implementation
|
2016-12-08 20:21:55 +00:00
|
|
|
and if the provider supports it.
|
2013-09-03 18:08:28 +00:00
|
|
|
|
|
|
|
## Options
|
|
|
|
|
|
|
|
* `--base NAME` - Instead of packaging a VirtualBox machine that Vagrant
|
|
|
|
manages, this will package a VirtualBox machine that VirtualBox manages.
|
|
|
|
`NAME` should be the name or UUID of the machine from the VirtualBox GUI.
|
2016-12-08 20:21:55 +00:00
|
|
|
Currently this option is only available for VirtualBox.
|
2013-09-03 18:08:28 +00:00
|
|
|
|
|
|
|
* `--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. These
|
|
|
|
can be used by a packaged Vagrantfile (documented below) to perform additional
|
|
|
|
tasks.
|
|
|
|
|
|
|
|
* `--vagrantfile FILE` - Packages a Vagrantfile with the box, that is loaded
|
2016-01-19 18:08:53 +00:00
|
|
|
as part of the [Vagrantfile load order](/docs/vagrantfile/#load-order)
|
2013-09-03 18:08:28 +00:00
|
|
|
when the resulting box is used.
|
|
|
|
|
|
|
|
<div class="alert alert-info">
|
2016-01-19 19:54:13 +00:00
|
|
|
<strong>A common misconception</strong> is that the <code>--vagrantfile</code>
|
|
|
|
option will package a Vagrantfile that is used when <code>vagrant init</code>
|
|
|
|
is used with this box. This is not the case. Instead, a Vagrantfile
|
|
|
|
is loaded and read as part of the Vagrant load process when the box is
|
|
|
|
used. For more information, read about the
|
|
|
|
<a href="/docs/vagrantfile/#load-order">Vagrantfile load order</a>.
|
2013-09-03 18:08:28 +00:00
|
|
|
</div>
|