1. Set the virtual machine to use bridge mode
2. Open the configuration file with Vi/etc/sysconfig/network-scripts/ifcfg-enp0s3 (where Enp0s3 is the name of your Linux network adapter, use IP addr in the shell) command to view its own name and change it to its own, immediately after the number of the argument is, not lo that)
Modify the following parameters
Change bootproute= "DHCP" to bootproute= "static"
Change onboot= "No" to onboot= "yes"
Then add the following parameters (location optional)
Ipaddr= "192.168.0.150" (note: Because the use of "bridge mode", so the IP address here must be and host in a network segment, set up to look at the host IP)
netmask= "255.255.255.0"
Nm_controlled= "No"
3. Turn off the firewall and enable the firewall to turn on port 22
sudo firewall-cmd--zone=public--add-port=22/tcp--permanent
4. Turn the firewall back on
sudo systemctl restart Firewalld.service
5. Restart the Network Service
sudo systemctl restart Network.service
6. Rebooting the system
Right-click Centos7, restart
7. Open the Xshell client
Input IP 192.168.0.150 connection, configuration complete
-------------------------------------------
Often make mistakes
1. Failed to restart Network service and virtual machine after modifying parameters
2. Firewall open 22 Port not set
Setting a static IP under virtual machine CENTOS7 and supporting Xshell remote login setting method