Use Xshell to connect VirtualBox in CentOS SSH best practices under window

Source: Internet
Author: User

There are already a lot of articles on how to connect to VMware online. But for some of the details that may be encountered is not fully spoken.

There will be a very
The actual sample, with links to all software, is guaranteed to be successful.

Best practices are deceptive.

1. Installing VirtualBox

In fact, VMware will have more comprehensive virtualization support, such as Cuda, here choose VirtualBox more easy to get started, for a development environment enough.
VirtualBox go directly to the official website to download the latest version, then remember to download VirtualBox Extension Pack. The VirtualBox corresponding VirtualBox Extension pack for the current version number is the link that the official website all supported platforms points to.

2. Installing CentOS
    1. Go to the CentOS website and choose CentOS 6.7 x64_86. Detailed links can be found in the Mirror list.
      Example. Sina's Mirror, download the smallest version number Centos-6.7-x86_64-minimal.iso can.

    2. Install CentOS in the VirtualBox. There is no need to repeat this, but all check hints are selected for skip. Also select the language of the installation process. And then it will be the language. Here the default us.

3.VirtualBoxport Forwarding Configuration
    1. Shutting down a virtual machine

    2. Network, right-click Virtual machine, Settings. Connection mode Select NAT, for example:

    3. Select port forwarding in the interface. Add an item. The client is the virtual machine that fills in the default SSH 22 and fills in a port number that you want to forward to the host. For example 9023. Nat network address translation. All the network packets of the client virtual machine are forwarded by the host, which is the machine you are using, so when the port forwarding is set, the 9023port of your connection to the machine is equivalent to 22port of the client.
      Example. On the host

ssh root@127.0.0.19023

is equivalent to 22port of the connecting client.


If you have more than two virtual machines, forward each 22port to a different host port, such as 9022 and 9023.

4. Check to see if the client is networked

1. Determine if the client can be networked

ping baidu.com

2. Assume that there is no successful connection. It is very likely that the NIC does not start by default.
Check it out, please.

show

3. If it is not open, temporarily open it. Then ping it.

4. To configure the network adapter each time you boot, you need to change the configuration file.

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Then set the onboot to Yes. Assuming that a low version of CentOS, such as 6.2 ifup eth0 , fails, it is most likely because the DHCP itself is not set up to obtain the network address, the above file can be changed to content. See footnote for detailed operation. 1

device= eth0   hwaddr=08 : 00 : 27 : 07 : C6:6  D   type= ethernet   uuid=e61ceb6d-9  A50-483  b-a9cd-9  b36bef9853d   onboot=yes    nm_controlled=yes    bootproto=dhcp    


5. Assume that you open the Web 443port, pay attention to the firewall white or directly shut down.

Otherwise there will be an outside web visit that has not returned regardless of the state of the connection.

stop
5. Host with Xshell to connect CentOS

1. Download the XSHELL5, the installation of the choice of personal and home use can be free of serial number.
2. Connect CentOS with Xshell

ssh root@127.0.0.19023

6. Second implementation: Host only dual NIC mode

Here VirtualBox in addition to the first NIC Nat can achieve access to the speaker 添加第二块网卡 , but also to implement host only.
Equivalent to the virtual machine to join a piece of communication only with the host network card, so there is no need to set up port forwarding, the host direct access to the virtual machine hostonly network card URL can be.


See: http://my.oschina.net/duangr/blog/182541

    1. Press I or a to enter insert mode. Press ESC to exit edit mode when you are finished changing. Input: Wq write and exit.

Use Xshell to connect VirtualBox in CentOS SSH best practices under window

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.