-
查看当前VirtualBox版本
vboxmanage --version
-
官网下载VirtualBox的扩展
Oracle_VM_VirtualBox_Extension_Pack-对应版本号.vbox-extpack
-
打开VirtualBox的preference中的extension中进行安装扩展
-
初始化Vagrantfile
mkdir ~/centos7
cd centos7
vagrant init centos/7
-
查看Vagrantfile
more Vagrantfile
- 运行虚拟机
vagrant up
- 终端链接虚拟机
vagrant ssh
- 更新软件
sudo yum update
- 断开和虚拟机的链接
exit
- 查看宿主机中虚拟机的状态
vagrant status
- 虚拟机关机
vagrant halt
- 销毁虚拟机
vagrant destroy