When using a virtual machine, I encountered connection failed. After consulting the information, I learned the following methods.
Three treatments to try
1. ssh service failure
The solution is to reinstall ssh.
The problem persists after trying to reinstall the ssh service
2. Host network card configuration failure
Check the network card of the host machine, all the network cards exist, and the status is normal. And my virtual machine uses the bridge mode, and it will not fail to connect due to the failure of the host mode network card and NAT network card.
3. The host has disabled the network service
Check the service, the vmware service is running and has been set to start automatically. For the same reason as above, virtual machines in bridge mode will not be unable to connect to the network because the host service is disabled.
Cause Analysis
In the host "Control Panel\All Control Panel Items\Network Connections", find the network card of the host to access the Internet, right-click and select Status, and select Details to view the host address. Try to ping the host in the virtual machine, and find that the host cannot be pinged successfully, and the echo unreachable is displayed. It is judged that there is a problem with the bridge.
Shut down the virtual machine and open the virtual network editor. Check the specific content of the bridge service and find that the bridge connection is automatic.
The possible reason is that there are two sets of virtual machine systems installed on this machine, and the priority of virtualbox is higher than that of Ethernet, which causes vmware to be bridged to virtualbox. Change the automatic selection to the host network card, and the problem is solved.