Recorded under the VirtualBox Configuration Virtual network card (bridge), the implementation of the host-virtual machine network interoperability process, the online search out of the relatively chaotic, said the shady, so according to their own once, confirm the feasible way, make a backup, convenient for future inspection.
Environment:
ubuntu installed in Oracle VM VirtualBox, the specific version name is: Ubuntu-14.10-server-amd64
STEP1:
VirtualBox in the virtual machine state, set:
Step 2:
Virtual machine boot up, input command: sudo ifconfig or sudo ifconfig-a view current NIC configuration
View current IP Address
STEP3:
Input command: vim/etc/network/interfaces
Open the network card configuration file, add eth1, save the changes. The contents of the modified file are as follows:
# This file describes the network interfaces available on your system# and how to activate them. For more information, see Interfaces (5). # The loopback network Interfaceauto loiface Lo inet loopback# the primary Network Interfaceauto eth0iface eth0 inet dhcpauto eth1iface eth1 inet Static
#本机当前ip地址, through the STEP2 ifconfig query out can address 192.168.56.11netmask 255.255.255.0
STEP4:
Restart the virtual machine (restart the host computer if necessary), and command ifconfig to view the current network card settings. Can see eth1, and have value, can.
STEP5:
1) cmd in Windows, command: ipconfig view current IP
2) in Ubuntu, enter command: Ping 192.168.56.1,enter, shown as follows:
The virtual machine accesses the host IP and passes.
Similarly, pinging the virtual machine IP in host cmd also goes through:
Results:
At this point, the virtual machine and Host Bridge network card successfully, IP interoperability, and the virtual machine successfully access the external network through the host network.
PS: About the specific contents of the configuration file, I did not scrutiny, nor too clear. This article is also after a period of time, recalled the writing, configuration steps such as missing, welcome to correct.
VirtualBox Configure virtual network card (bridge) for host-Virtual Machine network interoperability