VirtualBox local machine ssh connection configuration

The local virtual machine of virtualBox can be connected through ssh generally through bridge mode and Nat mode

In the bridge mode, sharing the local host network card, under the same LAN, you can connect directly by obtaining the IP address.

In Nat mode, the IP obtained is not in the same network segment as the local host, and port forwarding is required to connect the virtual machine with the local SSH.

The specific setting steps are as follows:

1. Choose port forwarding

 

2. The host Ip is empty. The default localhost can be set to 127.0.0.1, and the host port can be set at will. It does not conflict with the system port. Subsystem port 22 is also the default connection port for ssh.

 

Then use ssh to connect to localhost, just do

 

Guess you like

Origin blog.csdn.net/wxb880114/article/details/109234773