First of all, we need to know the conditions for connecting to the Linux system. We need to have the IP address, port, protocol, user name and password.
We first open the virtual machine and log in.
Open the installed Xshell 5 (if you haven’t downloaded it, you can download it at the end of the article), let’s click New.
Modify the name (custom), host (consistent with the Linux IP address), click OK, and our protocol and port will be defaulted.
You can see that it has been created, let's click Connect.
When prompted with a security warning, we click to accept and save to avoid having to accept it every time.
Perform the following operations according to the picture prompts.
Found that the login was successful and you're done!
If everything goes well, the link will be successful. However, we often fail to connect due to various problems during the operation. Next, I will provide you with some troubleshooting ideas.
First of all, we need to understand the link logic. How to link two computers. It is very simple. You can connect through a network cable. If two computers set the same network segment, you can build a LAN. But when we need to connect many computers, we need a switch, thus forming a local area network. The process of using Xshell to connect to the virtual machine is the process of interaction between computers. It is easy to troubleshoot if you know the principle.
First, we need to ping the IP address of the virtual machine system through local cmd or Xshell, taking 10.0.0.200 as an example.
ping 10.0.0.200
If the ping is successful, the connection is generally possible. If the ping cannot be successful, we first check whether the IP is 10.0.0.200 under the virtual machine.
If ping fails, we need to modify the system IP address to 10.0.0.200, which means modifying our network card configuration file.
vim /etc/sysconfig/network-scripts/ifcfg-eth0
If you don’t know how to operate it, you can refer to this article: vim and its shortcut key operation tutorial
You can also use the method of reinstalling the Linux system to solve the problem.
If you need to reinstall Linux, you can refer to this article: How to create a Linux system on VMware (CentOS7.9)
Secondly, we need to check the virtual network editor of the virtual machine to see whether the IP of Vmnet8 is 10.0.0.X and whether the subnet mask is 255.255.255.0. If not, modifications need to be made. We need to ensure that its subnet The IP is in the same network segment as the system IP settings. This virtual network editor has the same function as the switch.
If there is no problem here, we need to check the local Vmnet8. If the position in the box below is selected, there is no need to check, but if it is not selected, we need to set a fixed IP.
Open this computer and search for network links. We can see 1 and 8 of VMware Network. If you don't see it, the consequences will be serious. You can try to restore the default settings by clicking on the picture above. If not, uninstall and reinstall the virtual machine. If it is still there, If not, you can only reinstall the system.
Right click on the properties of VMnet8.
Double-click the protocol version.
Select Use the following IP address, make the following settings, and finally click OK.
If you have completed the above operations and still cannot find the IP, you can try to close NetworkManager, enter the first line of the command in the virtual machine, then press Enter, then enter the second line and press Enter.
systemctl stop NetworkManager #关闭此网络服务
systemctl disable NetworkManager #将此网络服务设置为开机不启动
You're done!
Xshell 5 download link: https://pan.baidu.com/s/1rJFVo1ySQL_UcqkIwi6lkQ?pwd=10g7
My name is Koten. I have 10 years of operation and maintenance experience. I continue to share operation and maintenance tips. Thank you for reading and paying attention!