window7的要使用 virtualbox 4.3.12可以成功
window10安装什么版本都可以

vagrant命令:
http://blog.csdn.net/54powerman/article/details/50669807

重启 – vagrant reload box的名字
连接 – vagrant.exe ssh box的名字
启动(创建) – vagrant.exe up box的名字
如果是在安装的文件下面如:
在 VM VirtualBox上安装 box文件
重启 – vagrant reload
连接 – vagrant.exe ssh
启动(创建) – vagrant.exe up

打开Git Bashv
1.查看是否已经安装vagrant
在 VM VirtualBox上安装 box文件
2.查看已有的box
这个是已经安装过一个box
在 VM VirtualBox上安装 box文件

这个是没有安装的在 VM VirtualBox上安装 box文件
3.添加一个box
centos720是起一个名字 后面的地址是box的目录
在 VM VirtualBox上安装 box文件
在 VM VirtualBox上安装 box文件
4.在vagrant新建一个目录test
5.在命名行中进入该目录在 VM VirtualBox上安装 box文件
6. vagrant.exe init 初始化
7. 在 VM VirtualBox上安装 box文件
打开 Vagrantfile 进行编辑在 VM VirtualBox上安装 box文件
这个配置是让test(本机目录)相当于虚拟机的目录
把要显示的文件放到test文件下
在 VM VirtualBox上安装 box文件
在 VM VirtualBox上安装 box文件
7.启动:
在 VM VirtualBox上安装 box文件
8.SSH连接:
在 VM VirtualBox上安装 box文件
9.将防火墙关闭
命令执行的时候前面加 sudo 获得最高权限
关闭防火墙 :
命令:systemctl stop firewalld.service #停止firewall
命令:systemctl disable firewalld.service #禁止firewall开机启动
命令:firewall-cmd --state #查看默认防火墙状态
10.安装apache
命令执行的时候前面加 sudo 获得最高权限
命令:yum install httpd #根据提示,输入Y安装即可成功安装
命令:systemctl start httpd.service #启动apache(要记得启动)
在 VM VirtualBox上安装 box文件

10.关闭:
虚拟机退出exit。

11.打包:
Vagrant package
Vagrant.exe box add 名字 /地址/package.box
Vagrant.exe init
修改配置
Vagrant up
Vagrant ssh

相关文章:

  • 2021-06-30
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-01-26
  • 2022-12-23
猜你喜欢
  • 2021-08-20
  • 2021-11-15
  • 2021-12-09
  • 2022-12-23
  • 2021-09-04
  • 2021-04-06
相关资源
相似解决方案