__都非拉得的博客

Posted on 11 Nov 2014

说明

机器A: Win 8.1 x64, IP: 192.168.1.5

机器B(虚拟机): CentOS 6.5 x64, IP: 192.168.1.8

约定: # 为root用户shell, $ 为非root用户shell, > 为windows cmd

下载与安装

创建虚拟机

安装CentOS (minimal)

具体请参照相关网上教程

配置CentOS

vagrant创建box

以下操作在机器A上进行

测试

通过ssh客户端工具(如:xshell,putty)连接一下刚配好的虚拟机,配置如下:

IP: 127.0.0.1
PORT: 2222
username: vagrant
password: vagrant

提示可以连接,到现在整个vagrant 虚拟机的安装过程结束, 接下来就可以根据各自的要求对vagrant虚拟机进行更加细致的配置了,如配置web服务器.

PS

> vagrant up

在出现mount share folders后 应该就结束了,但是今天启动后 却发现出现了疑似警告信息

==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.

后来在github上vagrant的issue中发现了以下内容

vagrant issue

So it is ,from now on we should use the commond :

> vagrant --provision

to up the vagrant virtual machine.