Use putty to connect to CentOS 7 on VirtualBox

Source: Internet
Author: User

Use putty to connect to CentOS 7 on VirtualBox

Idea: ensure that the host and virtual machine can be pinged before using putty to connect to the virtual machine through ssh.

There are two ways to search online.

One is to set the IP address of the VM to be in the same network segment as the host.

The other is relatively simple. You can addhost-onlyNic. After adding the NIC, the ip host and virtual machine can access each other.
PS: In this case, the virtual machine has two NICs, which can access the Internet through the NAT Nic and access the host through the HostOnly Nic.

This document introduces the second method.
For the first method, refer to this article [using Putty to connect to Linux in a virtual machine]


Nic 1 does not move


Add a new host-only NIC

Obtain the IP address of the VM before access.ifconfigCommand to view

The first is the IP address of the NAT Nic, and the second is the IP address of the host-only NIC.

Then, you can run the ping command on the host and virtual machine to check whether the two can be connected.

You can set putty.

Enter the IP address. Do not change the port. ssh uses port 22 by default.
Enter the name and save.
Double-click the settings you saved to go to the remote logon page.


Login successful ~~

PS: Make sure that the VM has been installed and ssh is enabled. Otherwise, the connection will fail.

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.