vagrant+virtualbox安装centos

一、下载安装vagrant
	01 访问Vagrant官网
	https://www.vagrantup.com/

	02 点击Download
	Windows,MacOS,Linux等

	03 选择对应的版本

	04 傻瓜式安装

	05 命令行输入vagrant,测试是否安装成功
	

二、下载安装virtualbox
	01 访问VirtualBox官网
	https://www.virtualbox.org/

	02 选择左侧的“Downloads”

	03 选择对应的操作系统版本

	04 傻瓜式安装

	05 [win10中若出现]安装virtualbox快完成时立即回滚,并提示安装出现严重错误
		(1)打开服务
		(2)找到Device Install Service和Device Setup Manager,然后启动
		(3)再次尝试安装

01 vagrant up时报如下错

There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
【解决方案】
开机启动时,进入BIOS设置,一般情况下按F2,但是要根据具体机型,这边可以自行百度
然后找到Configuration或者Security选项,选择Virtuallizationon或者Intel Virtual Technology,设置为Enabled,也就是开启虚拟化的支持,然后保存重启机器即可
还有一种可能性就是VirtualBox的版本过低,卸载之后下载官方最新的版本即可

02 输入vagrant时出现下面的提示

Vagrant failed to initialize at a very early stage:
The version of powershell currently installed on this host is less than
the required minimum version. Please upgrade the installed version of
powershell to the minimum required version and run the command again.
Installed version: 2
Minimum required version: 3

【解决方案】
主要是powershell版本过低,可以百度升级powershell
如果升级失败,这时候只能使用VM或者VirtualBox,手动导入镜像的方式安装centos

03 centos的网卡eth1没有ip信息

Vagrantfile文件中设置了config.vm.network “public_network”,创建centos7虚拟机之后,发现没有ip信息
【解决方案】
打开VirtualBox,在设置中将网卡2[eth1]从“桥接”改成“Host-Only”

看VIP课程中的Docker第三节课网络部分的内容

04 vagrant up出现如下提示

default:Which interface should the network bridge to?
【解决方案】
根据出现的windows上的网卡信息,输入序号进行选择,比如“0,1,2”

猜你喜欢

转载自blog.csdn.net/Baron_ND/article/details/120530034