下载iso镜像文件

下载完成后放置在对应的镜像目录以供后续使用
新建虚拟机
首先点击左上角[文件]--[新建虚拟机]
如下图所示

点击下一步

选择操作系统类别

根据自己的需求进行虚拟机命名

磁盘容量选择默认

点击完成

配置系统镜像文件---点击设置

配置镜像-网络或其他均选择默认选项

启动虚拟机-根据提示设置系统

设置root密码

等待安装完成后重启

安装依赖工具
yum install -y yum-utils device-mapper-persistent-data lvm2

以上问题是由于网络原因导致的不可访问
解决方案:
ip addr
查看当前网卡信息


回到vm虚拟机主界面-选中当前虚拟机(必须保证当前虚拟机网络位nat模式)


点击DHCP设置

使用vi或者vim命令编辑网卡

BOOTPROTO dhcp|static
ONBOOT 自动启动
IPADDR ip地址
NETMASK 子网掩码
GATEWAY 网关

使用wq命令保存网络信息并退出
配置好之后,需要重启网卡服务。systemctl restart network 或 service network restart 通过ifconfig 或ip addr确认IP
systemctl restart network
ip addr 查看网卡信息

ping www.baidu.com 测试网络情况

至此虚拟机配置centos7工作完成
网友评论