请看这个:
https://www.vagrantup.com/docs/vmware/boxes.html大致步骤就是,把 machine 导出,然后打包。
====
手上没有 Vmware ,用 VirtualBox 尝试了下。
Step1: 导出
VBoxManage.exe export "homestead-7" -o output\homestead.ovf
Step2: 创建 metadata.json (根据自己的需要修改,这个就是 box 文件的描述。如果你是 vmware ,请修改为: vmware_fusion 或者 vmware_workstation 。这个不大确定):
{
"provider": "virtualbox"
}
Step3: 打包
cd output
tar czvf virtualbox.box *
Step4: 添加到 vagrant
$ vagrant box add --name "test_box" --provider "virtualbox" virtualbox.box
Step5: 查看是否成功
$ vagrant.exe box list
laravel/homestead (virtualbox, 0)
test_box (virtualbox, 0)
====
vmware 如何导出,请看下面这个:
https://pubs.vmware.com/workstation-9/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-D1FEBF81-D0AA-469B-87C3-D8E8C45E4ED9.html====
关于 box :
Box files are compressed using tar, tar.gz, or zip. The contents of the archive can be anything, and is specific to each provider. Vagrant core itself only unpacks the boxes for use later.
验证了下:
$ file homestead.box
homestead_2016_05_03.box: gzip compressed data, last modified: Tue May 3 03:36:41 2016, from Unix
====
Good luck~