- 首先关闭虚拟机
H:\vagrant\redis-node1>vagrant halt
==> default: Attempting graceful shutdown of VM...
default: Guest communication could not be established! This is usually because
default: SSH is not running, the authentication information was changed,
default: or some other networking issue. Vagrant will force halt, if
default: capable.
==> default: Forcing shutdown of VM...
2. 打包
vagrant package --output docker.box
3.使用这个box添加到这台机器的box列表里面
vagrant box add newbox_names newbox_name.box
4.初始化,这样就初始化了一个虚拟机环境,然后执行vagrant up,你的小伙伴就可以得到一个和你完全一样的开发环境了
vagrant init newbox_names
5. 启动
vagrant up