Solve the problem that xshell cannot connect to the virtual machine, personal test is effective

xshell cannot connect to virtual machine

1. Start the local virtual machine and try to connect to the virtual machine with Xshell. The following interface will appear, indicating that the virtual machine cannot be connected.

Insert image description here

2. Open the virtual machine of this machine -> open the terminal of the virtual machine and try to ping Baidu to see if the ping can succeed. It shows that ping is not working.

Insert image description here

3. Open the directory folder where the virtual machine is located, check whether there are files with the suffix *.lck, and if so, delete them all.

Insert image description here

4. After deletion, search for *.lck and confirm complete deletion.

5. At this time, you can restart Xshell and check whether it is successful. If it is successful, it will end here. If it is not successful, continue to the following steps.

6. Open the computer's task manager -> click Services -> open services.

Insert image description here

7. Find the two services VMware NAT Service and VMnet DHCP Service in the service list, and right-click to start these two services.

8. After the startup is completed, return to the terminal of the virtual machine and try to ping Baidu. You can ping successfully.

Insert image description here

9.Xshell reconnects to the virtual machine.

Note: There is another situation where Xshell cannot connect to the virtual machine. The virtual machine can ping the host, and the host can also ping the virtual machine, but it just cannot connect. At this time, we can open C:\Windows\System32\drivers\etc , open the host file and check whether the mapping relationship written before is open.
——————————————
Copyright Statement: This article is an original article by CSDN blogger "朂后哋箹萣" and follows the CC 4.0 BY-SA copyright agreement. Please attach the original source for reprinting Links and this statement.
Original link: https://blog.csdn.net/z1171127310/article/details/125757915

Guess you like

Origin blog.csdn.net/qq_44881930/article/details/129327835