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就成功了。
相關文章
相關標籤/搜索