在阿里云镜像站下载CentOS6.8操作系统:
https://mirrors.aliyun.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-bin-DVD1.iso
https://mirrors.aliyun.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-bin-DVD2.iso
https://mirrors.aliyun.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-bin-DVD1to2.torrent
https://mirrors.aliyun.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-minimal.iso
https://mirrors.aliyun.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-minimal.torrent
遇到的问题:
installing VMware Tools, Please wait...
mount: special device /dev/had does not exit
mount: block device /dev/sr0 is write-protected,mounting read-only
解决办法1:不使用简易安装,新建虚拟机时选择稍后安装操作系统。
The CentOS disc was not found in any of your CDROM drives. Please insert the CentOS disc and press OK to retry.
解决办法:菜单栏选择虚拟机->可移动设备->CD/DVD(IDE)->连接
mount -o ro /dev/cdrom /media
[root@CentOS /]# cd /media
[root@CentOS /]# cp ./VMwareTools-10.0.6-3595377.tar.gz /tmp
[root@CentOS /]# cd /tmp
[root@CentOS tmp]# tar -zxvf ./VMwareTools-10.0.6-3595377.tar.gz
[root@CentOS tmp]# cd ./vmware-tools-distrib
[root@CentOS vmware-tools-distrib]# ./vmware-install.pl
然后按照提示安装即可。
出现过的问题:
/usr/bin/perl:bad interpreter:No such file or directory.
这是因为CentOS最小化安装时,没有安装Perl环境,需要使用yum groupinstall “Perl Support”来安装Perl。
安装open-vm-tools
CentOS7之后已经有带一个open-vm-tools,这是为了简化安装流程做的open source版本,所以CentOS7之后版本要安装VMware Tools直接使用下列指令就可以了。
yum -y install open-vm-tools
使用NAT模式连接网络
可能出现的问题
Internet 连接共享访问被启用时,出现了一个错误。
Internet connection Sharing cannot be enabled. A LAN connection is already configured with the IP address that is required for automatic IP addressing.
解决办法:把VMnet8的ip设置为自动获取或者设为192.168.0.1,然后重新设置共享。
vim /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=00:0c:29:A3:55:F1
TYPE=Ethernet
UUID=b47dcb09-98cc-4eaf-893e-0020ac444f07
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.137.10
NETMASK=255.255.255.0
GATEWAY=192.168.137.2
DNS1=114.114.114.114
IPV6INIT=no
USERCTL=no
ARPCHECK=no
service network restart
配置端口转发
此时主机能与虚拟机互通,但虚拟机与局域网其他主机不能连通,于是做一个端口转发
将CentOS的yum源更换为国内的阿里云源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
安装EPEL源
(一)手动安装
yum repolist
安装EPEL源
rpm -Uvh http://mirrors.kernel.org/fedora-epel/epel-release-latest-6.noarch.rpm
可能出现的问题
curl: (6) Couldn't resolve host 'mirrors.kernel.org'
error: skipping http://mirrors.kernel.org/fedora-epel/epel-release-latest-6.noarch.rpm - transfer failed
原因可能是DNS服务器解析失败。修改/etc/resolv.conf
添加一个DNS服务器
vi /etc/resolv.conf
; generated by /sbin/dhclient-script
search localdomain
nameserver 223.5.5.5
nameserver 8.8.8.8
(二)命令安装
yum -y install epel-release
yum repolistroot
http://www.centos.org/
http://www.centos.org/docs/
http://www.jianshu.com/p/99927be43a04
http://mirrors.aliyun.com/help/centos?spm=5176.bbsr150321.0.0.d6ykiD