vagrant在windows下的安装和配置

记录一下安装和配置过程当中的一些坑
步骤一
分别下载vagrant和VirtualBox,我这里下载的是vagrant_1.9.1.msi 和 VirtualBox-5.1.14-112924-Win.exeios

步骤二
这两个东东安装好以后,我在e盘建立了一个myvagrant目录,做为工程目录,进入该目录,进行添加boxcentos

其中centos7.0是自定义的box的名字,后面是本地box的路径app

添加完后 vagrant init cento7.0而后就会在myvagrant目录下生成一个vagrantfile文件ide

而后打开这个文件,修改一下这里this

=================================================centos7

配置好后,输入vagrant upspa

这样就启动成功了。vagrant

 

坑一:
就是在vagrant up的时候出现以下错误
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.3d

The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.

而后在stackoverflow看了答案,跟着改了仍是无果,最后我卸载掉原来安装好的virtualbox,而后去官网下载最新的virtualbox,版本是VirtualBox-5.1.14-112924-Win.exe
而后在vagrant up的时候这个错误就消失了,virtualbox版本的缘由code

坑二:

If you're using a custom box, make sure that networking is properly working and you're able to connect to the machine. It is a common problem that networking isn't setup properly in these boxes. Verify that authentication configurations are also setup properly, as well.  If the box appears to be booting properly, you may want to increase the timeout ("config.vm.boot_timeout") value.

由于配置的时候开启了调用virtualbox可视化界面,因此出现这个提示的时候,virtualbox那也会弹出一个警告
VT-x/AMD-V硬件加速在您的系统中不可用。您的64-位虚拟机将没法检测到 64-位处理器,从而没法启动。在网上找到解决办法是重启按f2进入bios设置,而后开启虚拟化支持,而后保存,从新启动,这个时候再用vagrant up就成功了。
相关文章
相关标签/搜索