Abstract: implements network communication between host machines and virtual machines
Environment:
Host operating system Windows XP
Virtual Machine Software VirtualBox
Virtual Machine operating system Linux
Principle:
Host-only (host Mode)
In some special network debugging environments, you must isolate the real environment from the virtual environment. In this case, you can adopt the host-only mode. In host-only mode, all virtual systems can communicate with each other, but the virtual system and the real network are isolated.
Tip: in host-only mode, the virtual system and the host machine system can communicate with each other, equivalent to the two machines connected through twisted pair wires.
In host-only mode, the TCP/IP configuration information of the virtual system (such as the IP address, gateway address, and DNS server) is created by VMnet1 (host-only) DHCP servers in the virtual network are dynamically allocated.
If you want to use VirtualBox to create a virtual system isolated from other machines in the network and perform some special network debugging, you can select the host-only mode.
Steps:
1. Check the IP Address Configuration of the host machine:
Enter the ipconfig command in the window XP command prompt line
The host machine IP address is 192.168.56.1.
Then, we configure the IP address of the same network segment on the virtual machine. Communication
2. Configure VBOX
Set network connection in VirtualBox and enable host-only connection mode.
In the virtual machine LIUNX
# Cd/etc/sysconfig/network-scripts
# Cp ifcfg-eh0 ifcfg-eth1
# Vi ifcfg-eh1
DEVICE = eth1
IPADDR = 192.168.56.56
NETMASK = 255.255.255.0
# Service network restart
# Ping 192.168.56.1
OK