(1) Modify the virtual machine configuration
(2) Modify the linux configuration vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=YES
(3) Restart the network service service network restart
Reference address http://www.5ycode.com/article/347.html