Go to GuestOS:
#/Sbin/ifconfig
View inet addr: 10.0.2.15
Then go to the HostOS to check the control panel and the VirtualBox Host-Only Network in the Network and sharing center.
Ip address of the ipv4 attribute: 192.168.56.1
If you have prepared enough, configure it as follows:
Notes: The default ssh port is 22.
Open the virtualbox settings window> network> Adapter1 enable network connection> connection mode: Nat> access network cable>
Port Forwarding:
Map the TCP 192.168.56.1: 2222 to 10.0.2.15: 22.
Restart a virtual machine Linux.
Open the ssh logon tool, such as putty.
Session-> host name (or ip address) 192.168.56.1; port: 2222-> open
Enter username/passwd to log on.
The actual login process is completed by the host machine through port forwarding, and the information of 192.168.56.1: 2222 will be forwarded to the Virtual Machine linux 10.0.2.15: 22