VirtualBox configuration environment for mutual access between internal and external networks: host machine operating system Windows XP sp3 Virtual Machine Software VirtualBox virtual machine operating system Fedora (Linux) I. How to enable the Virtual Computer Fedora to access www.2cto.com: NAT (network address translation mode) uses the NAT mode to allow the virtual system to access the public network through the network of the host machine through the NAT (Network Address Translation) function. That is to say, you can use the NAT mode to access the Internet in a virtual system. In NAT mode, the TCP/IP configuration information of the virtual system is provided by the DHCP server of the VMnet8 (NAT) Virtual Network and cannot be modified manually, therefore, the virtual system cannot communicate with other real hosts in the local area network. The biggest advantage of using the NAT mode is that it is very easy for the virtual system to access the Internet. You do not need to configure any other configurations, but only need the host machine to access the Internet. If you want to use VMWare to install a new virtual system, you can directly access the Internet without manual configuration in the virtual system. We recommend that you use the NAT mode. Step: Set the network connection in VirtualBox and enable the NAT connection mode.
Start Fedora and find that the network is connected successfully. Run FireFox to log on to the Fedora webpage.
Here we can check the IP address of Fedora and the network configuration of Windows, and ping each other.
Fedora can ping Windows
However, Windows cannot ping Fedora. Because the network connection mode of NAT is that the virtual machine accesses the Internet through the network of the host machine, the Virtual Machine certainly knows the network address of the host machine. However, Windows does not know how to route to 10.0.2.15. Note that the IP address 10.0.2.5 of Fedora is automatically allocated through DHCP. Www.2cto.com 2. To enable the Virtual Computer Fedora to interconnect with the host machine, the objective is to enable Windows to ping Fedora. Principle: In this mode, the virtualized Operating System of VirtualBox is like an independent host in the LAN, which can access any machine in the network. In the bridge mode, you need to manually configure the IP address and subnet mask for the virtual system, and also need to be in the same network segment as the host machine, so that the virtual system can communicate with the host machine. At the same time, because the virtual system is an independent host system in the LAN, You can manually configure its TCP/IP configuration information to access the Internet through the LAN gateway or router.
The relationship between a virtual system in the bridge mode and the host machine is like connecting two computers on the same Hub. If you want them to communicate with each other, You need to configure the IP address and subnet mask for the virtual system. Otherwise, the communication will fail. If you want to use VirtualBox to create a virtual server in the LAN to provide network services for LAN users, you should select the bridge mode. Step: Set network connection in VirtualBox and enable Bridge Adapter connection mode
Start Fedora and find an unconfigured Nic eht1
Add a network configuration for the network card, and manually enter the IP address, subnet mask, and gateway (which must be in the same network segment as the host)
Check the network information and ping the host (this is done in the previous section)
Host ping VM
Successful ping 2. Supplement: The third connection method must be mentioned here, that is, what if the IP address 172.16.35.237 has been used by other computers? To solve this IP address conflict, let's take a closer look at the host-only connection mode. Principle of www.2cto.com: host-only (host mode) in some special network debugging environments requires that the real environment and virtual environment be isolated, then 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. Step: Set network connection in VirtualBox and enable host-only connection mode.
Start Fedora and find an configured Nic eht2
Because the IP addresses of eth1 and eth2 are both 172.16.35.237, the ping operation fails on Windows. It does not know which one it is.
Now, add a network configuration for the network card and set it to the same network segment as the VirtualBox gateway 192.168.56.1.
The network configuration is www.2cto.com.
After the configuration, You can ping the address 172.16.35.237 on the Windows side and then successfully. Ping the new IP address. TIPS: when adding or deleting network configurations on the Fedora window interface, the system may not update the network configuration information in time. You can use the/etc/rc command on the terminal. d/init. d/network restart to restart the network connection. Author jrl137824675