How to install Linux CentOS 7.7 system in Vmware, and it is a minimal installation. Afterwards, make necessary configuration changes and realize basic optimization. Finally, take a snapshot.
Installation requirements: The installed virtual machine is used for the server, so the installation should be minimized, no redundant software, and no graphical interface.
How to create a virtual machine see: "VMware How to Create a Virtual Machine and Set Virtual Machine Network"
Start the virtual machine
Choose (by up and down keys to switch options) the first one, install CentOS 7
Select the keyboard mode, select the language and the country where the language is located (for example: American English, British English, Indian English, Australian English, Canadian English, etc.)
Choice: Asia/Shanghai
Minimal installation
Partition manually by yourself
/boot partition disk size allocation
/ Root partition disk size allocation
Results after partition
Partition effective
Note: After installation, there is no ifconfig command
Don't use the default hostname
1[ root@localhost ~]# vim /etc/hostname
2 zhang
3[ root@localhost ~]# hostname zhang
After the operation is complete, log in again and you will find that the hostname has been changed.
The default network card name is not eth0, eth1. So it needs to be modified.
Modify the /etc/default/grub file and add in the variable GRUB_CMDLINE_LINU: net.ifnames=0 to disable the new naming rule.
1[ root@zhang ~]# cat /etc/default/grub
2 GRUB_TIMEOUT=53 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"4 GRUB_DEFAULT=saved
5 GRUB_DISABLE_SUBMENU=true6 GRUB_TERMINAL_OUTPUT="console"7 GRUB_CMDLINE_LINUX="net.ifnames=0 crashkernel=auto spectre_v2=retpoline rhgb quiet"8 GRUB_DISABLE_RECOVERY="true"
After saving, we need to regenerate the grub configuration file and update the kernel parameters. For this we need to run:
# grub2-mkconfig -o /etc/grub2.cfg #The result is as follows
Network card rename
1 # cd /etc/sysconfig/network-scripts/2 # mv ifcfg-ens33 ifcfg-eth0
3 # mv ifcfg-ens37 ifcfg-eth1
eth0 (intranet) modified file content
1[ root@zhang network-scripts]# cat ifcfg-eth0
2 DEVICE=eth0
3 TYPE=Ethernet
4 ONBOOT=yes
5 NM_CONTROLLED=yes
6 BOOTPROTO=none
7 IPV6INIT=yes
8 USERCTL=no
9 IPADDR=172.16.1.10010 NETMASK=255.255.255.0
eth1 (external network) modified file content
1[ root@zhang network-scripts]# cat ifcfg-eth1
2 DEVICE=eth1
3 TYPE=Ethernet
4 ONBOOT=yes
5 NM_CONTROLLED=yes
6 BOOTPROTO=none
7 IPV6INIT=yes
8 USERCTL=no
9 IPADDR=10.0.0.10010 NETMASK=255.255.255.011 GATEWAY=10.0.0.212 DNS1=223.5.5.513 DNS2=223.6.6.6
Remarks:
# systemctl restart network.service
Restart the network card service, it will take effect.
It can be seen that the Internet is normal
How to install ifconfig command
1 # yum search ifconfig #Query which toolkit the command is in
2 # yum install -y net-tools
Execute ifconfig command
1 # Related URL:
2 https://github.com/zhanglianghhh/system-install/blob/master/linux-CenetOS7/basedOptimi_7.sh
Specific optimization points:
After completing the above steps, the entire Vmware Linux CentOS 7.7 deployment has actually been completed. But there is an important step that must be completed.
This virtual machine is used as a template, and other virtual machines are cloned from this virtual machine, and the cloned is the state of the virtual machine at the moment, and to ensure that the current state of the virtual machine can be restored even if it is changed . So we need to take a snapshot to save the current state of the virtual machine.
Shut down the client, in order to save disk space, so we shut down first, and then take a snapshot.
Choose snapshot management
Write the name and description of the snapshot. It must be meaningful, otherwise I don't know what it is after a long time.
Snapshot finished
"VMware how to create a virtual machine and set up a virtual machine network""
complete!
———END———
If you feel good, pay attention (-^O^-)!
Recommended Posts