Virtual machine installation and configuration CentOS7 smallest version
Background The reason: By taking into account CentOS7 installation package occupies too large, and here I need to install CentOS minimum personal follow-up of some configuration which will continue to add
Virtual machine installation process is the smallest version of CentOS (CentOS-7-x86_64-Minimal -1810.iso) I will not elaborate here , you can refer to: https://blog.csdn.net/hellboy0621/article/details/80392273
1.VMware minimize installation centos7 installation shared folder with Windows virtual machines share a folder
1. Click Install VMware Tools in virtual tab
2. to enter the virtual machine as the root user and create the directory
[root @ localhost ~] # mkdir -p / mnt / cdrom
3. Load-ROM CD
[root @ localhost mnt] # Mount Auto -t / dev / CDROM / mnt / CDROM
4. the installation package VMware-Tools copied to / tmp
[the root @ localhost mnt] # CD / tmp /
[the root @ localhost tmp] # CP / mnt / CDROM / VMwareTools- ./ 9.6.2-1688356.tar.gz
5. The resulting extract file vmware-tools-distrib
the tar-9.6.2-1688356.tar.gz -xzvf the VMwareTools
6. The vmware-tools-distrib into the run command vmware-install.pl : ./ vmware-install.pl
---------------- installation VMwere Tools ----------------------- -
encountered a problem 1: bash: ./vmware-install.pl: / usr / bin / perl: Bad Interpreter: no such file or directory
solution
yum install gcc Kernel perl-devel
yum upgrade Kernel Kernel-devel
遇到问题2:centos 7 The path "" is not a valid path to the 3.10.0-957.5.1.el7.x86_64 kernel headers. Would you like to change it?
Solution: Would you like to change it no longer all the way to enter?
3 encountered a problem: After installing VMWare tools / mnt have hgfs but did not share files
Prerequisite: Set up the software in a virtual machine shared directory
at this time to enter / mnt / hgfs folder in linux, but found shared files do not appear
to use the following solution (root privileges):
1. vmware-hgfsclient command to view shared directories which currently have, here I only use the share folder
[root@centos7 share]# vmware-hgfsclient
share
2. hanging in the shared file directory
[root@centos7 hgfs]# mount -t vmhgfs .host:/share /mnt/hgfs
Error: cannot mount filesystem: No such device
NOTE:
If the display
can not mount filesystem:: No such device Error
centos7 the first execution yum install open-vm-tools
Then perform vmhgfs-fuse .host: / share / mnt / hgfs
3. Mount --- permanent boot automatically mount
vi /etc/fstab
In order to add the last row .host: / / mnt / hgfs fuse.vmhgfs-fuse allow_other 0 0
Note here must byte alignment, or can not be switched
2. Install Tool Set command
[root@localhost vmware-tools-distrib]# yum -y install net-tools vim-enhanced wget
3. Close CentOS7 firewall that comes with firewall enabled IPtable
停止 Firewall
systemctl stop firewalld
systemctl mask firewalld
Close firewall automatically start
systemctl disable firewalld.service
Installation IPtables firewall
yum install -y iptables-services
Open ports
VI / etc / sysconfig / iptables
# Add the following three sentences to the default port 22 following this rule
# open port 443 (the HTTPS)
# open service
-A INPUT -m state -state NEW -m tcp -p tcp 80 -j ACCEPT - dport
-A State -state the INPUT NEW -m -m -p TCP TCP - dport 4433 -j ACCEPT
-A State -state the INPUT NEW -m -m -p TCP TCP - dport 3306 -j ACCEPT
Restart iptables
systemctl restart iptables.service
add iptables boot from Kai items
systemctl enable iptables.service
Check firewall status
service iptables status
4. Alternatively centos7 source comes yum
# To enter the source directory
cd /etc/yum.repo.d
# backup at the official source
mv-Base.repo CentOS CentOS-Base.repo.bak
# source file to download Ali down
wget -O /etc/yum.repos. D / the CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# reconstruct the original data cache
yum makecache
OK, complete source exchange