My home computer uses Unicom's broadband, using VirtualBox installed CENTOS6, connection using the NAT network, there is a network address translation (NAT), not clear what the difference is, using Xshell connection
When using cd/etc/sysconfig/network-script/to view files, there are a lot of times only one ifcfg-lo, but using Ifconfig view can see Eth0 interface, then you need to create a new Ifcfg-eth0 file, And do the following configuration
Device=eth0
Type=ethernet
Onboot=yes
Bootproto=static
ipaddr=10.0.2.15
netmask=255.255.255.0
Hwaddr=08:00:27:ff:1b:95
gateway=10.0.2.1
dns1=114.114.114.114
Some notes
1. If bootproto=dhcp, so that the virtual machine can also be connected to the network, but the use of Xshell connection will appear the following error, so you must use static address
2. VirtualBox The default virtual network segment is 10.0.2.X/24, so you need to configure the appropriate IP
Xshell Connecting a CentOS virtual machine is always unsuccessful