Virtualbox+Vagrant安装Centos7

步骤一:确定电脑的cpu开启CPU虚拟化
Virtualbox+Vagrant安装Centos7
步骤二:下载Virturalbox并完成安装
下载地址:https://www.virtualbox.org/wiki/Downloads
Virtualbox+Vagrant安装Centos7
步骤三:下载Vagrant并完成安装,并且电脑要重启
下载地址:https://www.vagrantup.com
下载会超级慢,而且还总失败,建议使用迅雷离线下载
Virtualbox+Vagrant安装Centos7

步骤四:在cmd中运行:vagrant
Virtualbox+Vagrant安装Centos7
出现以下信息,代表安装成功
步骤五:下载virtualbox.box镜像,并将该镜像放到本地文件夹下
下载地址:https://app.vagrantup.com/boxes/search
Virtualbox+Vagrant安装Centos7
步骤六:cmd中运行:vagrant box add centos/7 D:\mycentos\virtualbox.box
Virtualbox+Vagrant安装Centos7
步骤七:在D:\mycentos下cmd:vagrant init centos/7
Virtualbox+Vagrant安装Centos7此时在文件夹上会生成一个文件,如上图所示

步骤八:打开该文件,修改如下的配置:

Virtualbox+Vagrant安装Centos7步骤九:cmd中输入vagrant up 代表启动虚拟机
Virtualbox+Vagrant安装Centos7
步骤十:cmd中输入vagrant ssh 连接虚拟机