windows 使用 vmware安装 centos7虚拟机
1. 安装vmware
1.1 获取vmware 安装包
网盘获取地址:https://pan.quark.cn/s/ee83c2fe9bd0
1.2 双击文件开始安装
等待安装向导。。。
更改安装目录,不建议默认的C盘,点击下一步
取消勾选两个框,下一步
等待安装完成 。。 要是中途有弹出什么框,点确定就行
点击完成,双击 VMware 启动 。。
选择第一个 “将VMware Workstation 17 用于个人用途” 就行,因为我之前安装过,为了做笔记,卸载重装,这一次安装没有出现这个就直接进去了。。
网上看了下帖子,找了张图,应该是大差不差
到这 vmware安装完成。。
2. 使用vmware 创建虚拟机
2.1 创建虚拟机基本配置
这边还是不建议安装在 C 盘
根据需求调整,我这边使用默认
一样的根据自己需求调整,我这边设置2G
网络使用NAT
这边一样的根据自己实际情况调整
然后点击完成。。
2.2 为创建的linux 挂载操作系统
操作系统下载地址:
http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso
去迅雷下载!!!
右击虚拟机,点击设置
CD/DVD——>使用ISO镜像,选择前面下载的镜像
开启虚拟机
用键盘的方向键,选中“Install CentOS 7”, 按回车,开始安装
设置时区
系统设置
最后变成这样 ,要是没反应就再点击设置一次
等待安装设置。。。 时间会比较久
设置密码
时间也有点久。。
最后重启
输入账号密码
2.3 网络设置
记住这些信息
设置windows中的 vMnet8
设置虚拟机的网络
登录虚拟机,编辑文件
vi /etc/sysconfig/network-scripts/ifcfg-ens33
添加配置
IPADDR=192.168.117.88
NETMASK=255.255.255.0
GATEWAY=192.168.117.2
DNS1=8.8.8.8
重启网络服务
systemctl restart network
3. 安装常用软件 出现问题 以及 解决
3.1 例如 安装 vim
yum -y install vim
就会报错,表示这个连接访问不了
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
首先网络肯定是没有问题的
因为需要换 源,这个源下载不了,就换国内镜像
备份系统自带源配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back
下载使用阿里的源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
执行
yum makecache
这样就可以正常下载了