1. Download the CenOS system
Download the system CenOS official website under the
CenOS official website
Two, install CenOS 7
You choose the processor and the number of cores according to your needs. Generally, one processor and two cores are OK.
Choose the memory allocated for the virtual machine, generally about 1~2G is enough.
Choose NAT network type
Choose the size of the disk allocated for the virtual machine, generally 20G is appropriate.
Choose the Centos mirror you downloaded here.
Set the virtual machine power-on password So
far, our virtual machine is installed, but he can't access the network and needs to configure the ip address.
Here you can shut down and back up the virtual machine
Three, network configuration
Confirm that the virtual machine selects the NAT network mode.
View the computer network information. After
viewing, you can return to the virtual machine page and enter the following commands in the virtual machine
vi /etc/sysconfig/network-scripts/ifcfg-ens33
According to the previously viewed network information, click the keyboard insert button to configure the network for the CenOS 7 system. After the configuration is complete, press ESC and enter: wq (note the English colon)
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
IPADDR=192.168.199.55
GATEWAY=192.168.199.2
DNS1=192.168.199.2
NAME=ens33
UUID=59738a3e-a489-43e0-8284-248329bd3c8f
DEVICE=ens33
ONBOOT=yes
Restart the network card after modifying the configuration
systemctl restart network
Four, installation tools
Now the system still cannot use ifconfig and vim commands, we execute the following three commands to install them in sequence.
yum update
yum install net‐tools
yum install vim
Option to turn off the firewall
systemctl stop firewalld #关闭防火墙服务网
systemctl disable firewalld #设置防火墙服务开机不启动
Five, configure Alibaba Cloud image
#安装wget
yum -y install wget
# 备份旧的 yum 源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载阿里云 repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 清除缓存
yum clean all
# 生成缓存
yum makecache
At this point, the virtual machine CenOS 7 has been installed and configured, and novices can take a snapshot here to facilitate the restoration of the virtual machine in the future.