After installing the CentOS virtual machine in the Virtalbox, it is inconvenient to operate directly in the virtual machine, so I want to use the CRT to connect the virtual machine.
1, open VirtualBox, set-Network, network connection 2 Set the connection mode is "bridged Adapter"
2, start the virtual machine, ifconfig view eth1 network status, if the machine is dynamic acquisition of IP, here eth1 will appear a and native IP similar IP, this IP is the CRT available IP
Later, the company changed to manually set the IP, and the station and fixed IP was bound, the original settings can not be used, changed to manually obtain the IP, if the above two steps, after the start of the virtual machine prompts eth1 boot failure, view eth1 does not have an IP address. Because the native IP is 192.168.60.x1, the available virtual machine is requested IP:192.168.60.X2
Sudo ifconfig eth1 192.168.60.x2 netmask 255.255.255.0
Sudo ifconfig eth1 up
Ifconfig after viewing eth1 has been shown as configured IP, at this time ping outside the network, ping the host, the host ping virtual machine can be, (at first do not know the virtual machine configuration and host the same network segment, the result is not the host ping different virtual, is the virtual machine ping not through the host)
Restart Network Service: Service network restart
The result still prompts eth1 to fail
4, the above method only use a single connection virtual machine, if you want to connect each time, you have to modify the eth1 file configuration
Vim/etc/sysconfig/network-scripts/ifcfg-eth1
Change Onboot=no to Onboot=yes activate NIC
Change BOOTPROTO=DHCP to Bootproto=static
Add ipaddr and NETMASK (subnet mask)
Configured as follows
Configure and then restart the Network Service services Network Restart,ok
Virtual Machine ping host, ping outside the network, the host ping virtual machine can be ping, and finally with the CRT can connect the configured virtual machine IP
CRT connection Vitualbox in CentOS virtual machine