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 init - Command-Line Interface"
|
2013-09-03 18:08:28 +00:00
|
|
|
sidebar_current: "cli-init"
|
2016-01-19 18:08:53 +00:00
|
|
|
description: |-
|
|
|
|
The "vagrant init" command is used to initialize the current directory to be
|
|
|
|
a Vagrant environment by creating an initial Vagrantfile.
|
2013-09-03 18:08:28 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Init
|
|
|
|
|
|
|
|
**Command: `vagrant init [box-name] [box-url]`**
|
|
|
|
|
|
|
|
This initializes the current directory to be a Vagrant environment
|
2016-01-19 18:08:53 +00:00
|
|
|
by creating an initial [Vagrantfile](/docs/vagrantfile/) if
|
|
|
|
one does not already exist.
|
2013-09-03 18:08:28 +00:00
|
|
|
|
|
|
|
If a first argument is given, it will prepopulate the `config.vm.box`
|
|
|
|
setting in the created Vagrantfile.
|
|
|
|
|
|
|
|
If a second argument is given, it will prepopulate the `config.vm.box_url`
|
|
|
|
setting in the created Vagrantfile.
|
2014-05-01 01:50:00 +00:00
|
|
|
|
|
|
|
## Options
|
|
|
|
|
|
|
|
* `--force` - If specified, this command will overwite any existing
|
|
|
|
`Vagrantfile`.
|
2014-05-05 00:38:25 +00:00
|
|
|
|
|
|
|
* `--minimal` - If specified, a minimal Vagrantfile will be created. This
|
|
|
|
Vagrantfile does not contain the instructional comments that the normal
|
|
|
|
Vagrantfile contains.
|
|
|
|
|
|
|
|
* `--output FILE` - This will output the Vagrantfile to the given file.
|
|
|
|
If this is "-", the Vagrantfile will be sent to stdout.
|