vagrant在windows下的安裝和配置(一)


記錄一下安裝和配置過程中的一些坑
步驟一
分別下載vagrant和VirtualBox,我這里下載的是vagrant_1.9.1.msi 和 VirtualBox-5.1.14-112924-Win.exe

步驟二
這兩個東東安裝好之后,我在e盤創建了一個myvagrant目錄,作為工程目錄,進入該目錄,進行添加box

其中centos7.0是自定義的box的名字,后面是本地box的路徑

添加完后 vagrant init cento7.0然后就會在myvagrant目錄下生成一個vagrantfile文件

 

然后打開這個文件,修改一下這里

=================================================

=================================================

配置好后,輸入vagrant up

 

這樣就啟動成功了。

 

 

 

 

 


坑一:
就是在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.

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版本的原因

坑二:

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就成功了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM