右鍵打開安裝包按照提示安裝便可
安裝後會自動把vagrant添加到環境變量中linux
web
vagrant box add centos6.3 https://s3.amazonaws.com/itmat-public/centos-6.3-chef-10.14.2.box
mkdir dev
cd dev
vagrant init
mkdir src
##Edit Vagrantfile
## 設置端口轉發,把guest的80端口轉發到host的8080端口
config.vm.network "forwarded_port", guest: 80, host: 8080
## 掛載文件到gust
config.vm.synced_folder "src", "/opt/web/dev"
## 禁用默認掛載
config.vm.synced_folder "/", "/vagrant" disabled: truewindows
配置修改後須要執行以下命令使配置生效
vagrant reloadcentos
在windows下使用vagrant ssh是沒法鏈接到gust的
可是在執行vagrant ssh以後會給出鏈接方法
bash
ssh
executable not found in any directories in the %PATH% variable. Is an
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
contain an SSH client. Or use your favorite SSH client with the following
authentication information shown below:
Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: C:/Users/username/.vagrant.d/insecure_private_key
使用putty鏈接127.0.0.1的2222端口便可ssh