Access Linux in a virtual machine in NAT network mode through ssh

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.