VirtualBox network configuration, Host Only+nat mode

Source: Internet
Author: User

In fact, the network of such related articles a lot, I just want to combine their actual situation, my experience to write down to those who need it. Host: Windows XP virtual machine: Ubuntu 10.10 virtualbox:4.0.2

After the virtual machine is installed, by default, it is through the network connection of NAT, in which case, the virtual machine can go to the internet normally, but cannot communicate with host. The effect we want is that the physical machine can access the virtual machine via IP, while the virtual machine can access the Internet.

What we need to do is to enable the second network interface and change the interface to hostonly mode. The purpose of this interface is to communicate with the host. After the VBox is installed, the physical host system automatically generates a network adapter (VirtualBox host-only Network), which, by default, is 192.168.56.1, and remember to make sure that the NIC is set to Enabled.

After the virtual machine is started, there will be two network cards, one is the original network card, IP address under normal circumstances will be 10.0.2.x, this network card is connected with the host through NAT, mainly used to access the network, in addition, there will be a new network card, the IP set to 192.168.56.x, The gateway is set to 192.168.56.1, the purpose of which is to communicate with the physical machine.

After some setup, the virtual machine should be able to access the physical machine via IP, and can access the network at the same time. Note that in this configuration, if the physical host is in a local area network, then other hosts on the LAN cannot be accessed via IP.

If other hosts in the local area network are required to access the virtual machine, the network connection of the virtual machine needs to be changed from host to bridged Adapter and the actual physical network interface on the physical host is selected as the Access interface. If the network is IP via DHCP, the virtual machine can obtain an IP address that is equal to the physical machine, as if a new physical machine is plugged into the LAN. If you do not have DHCP, then manually set an equivalent IP address to the physical host, you can get the same effect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.