Recently, after some research, we finally tuned the VirtualBox VIRTUAL machine interconnection, the host machine interconnection, and the host machine connection to the Internet. Share them below.

1. Virtual nics in VirtualBox. After VirtualBox is installed, a virtual network card will be installed in the system, which can be seen in administration -> Global Settings. This nic is a bridge between the Host and the Host in host-only connection mode.

2. The Host accesses the VM in Host Only mode.

Host access to the VM this is the easiest. By selecting the Host-only Adapter in Network Connection 1, our VM can obtain an Intranet address that the Host can directly access. You can use DHCP, or you can specify your own IP address. In most cases, you will specify a fixed IP address.

3. To enable the VM to access the Internet, you can add another nic to the VM and use Bridge to access the Internet.

4, but the author in this setting, test ping www.baidu.com, found that the network did not pass, carefully check found that we need to configure the second nic, specify his gateway. I added it in /etc/sysconfig/network-scripts/ifcfg-eth1

GATEWAY = 10.207.0.11

After you restart the network, you can PING through it.

In this way, we can not only access virtual machines, but also access the Internet, using a variety of online update tools, greatly facilitate the use of Linux.

Technorati tags: Virtual box, Virtual machine, Internet access