1、安装VM-Tools
VMware Workstation —> VM —> Reinstall VMware Tools
tar -zxvf ~/tools/VMwareTools-10.3.2-9925305.tar.gz -C /root/
~/vmware-tools-distrib/vmware-install.pl
2、Linux不休眠
vim /etc/systemd/logind.conf
HandleLidSwitch=lock
3、修改IP地址(静态)与DNS
vim /etc/sysconfig/network-scripts/ifcfg-ethXXXX
DNS1=114.114.114.114
BOOTPROTO=static
IPADDR=192.168.156.120
GATEWAY=192.168.156.2
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=yes
4、重启网络服务
service network restart
5、永久关闭防火墙和Selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
chkconfig iptables off
setenforce 0
vi /etc/selinux/config
SELINUX=disabled
6、重启Linux
reboot
7、注意事项
(1)查看虚拟机网关与IP地址范围
VMware Workstation--->Edit--->Vitual Network Editor--->NAT VMnet8--->NAT Settings--->Gateway IP
VMware Workstation--->Edit--->Vitual Network Editor--->NAT VMnet8--->DHCP Settings --->Starting/Ending IP address
(2)修改虚拟机网关或IP
VMware Workstation--->Edit--->Vitual Network Editor--->Change Settings--->授权--->进入对应位置修改
(3)Linux的ip地址、网关的设置与虚拟机的网卡设置要相匹配