Linux command
vagrant-init 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Initialize with default box
vagrant init
Initialize with specific box
vagrant init [box_name]
Initialize with minimal Vagrantfile
vagrant init -m [box_name]
Initialize with box URL
vagrant init [name] [url]
说明
vagrant init creates a new Vagrantfile in the current directory. The Vagrantfile defines VM configuration including box, networking, and provisioning. Start of every Vagrant project.
参数
- -m, --minimal
- Create minimal Vagrantfile.
- -f, --force
- Overwrite existing Vagrantfile.
- --box-version _version_
- Specify box version.
- -o, --output _file_
- Output file path.
FAQ
What is the vagrant-init command used for?
vagrant init creates a new Vagrantfile in the current directory. The Vagrantfile defines VM configuration including box, networking, and provisioning. Start of every Vagrant project.
How do I run a basic vagrant-init example?
Run `vagrant init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -m, --minimal do in vagrant-init?
Create minimal Vagrantfile.