VirtualBox Host-only Understanding and practice

Source: Internet
Author: User


1 Conceptual Understanding

Host-only as the name implies, this technology provides network visits between hosts and virtual machines , rather than the technology of virtual machines accessing the Internet.

In some special network debugging environments, it is required to isolate the real environment from the virtual environment (that is, you do not want the extranet environment to access the virtual machine, and do not want the virtual machine to access the extranet environment), then you can use the host-only mode. In host-only mode, all virtual systems can communicate with each other, but virtual systems and real networks are isolated.

Note: In host-only mode, the virtual system and the host machine system can communicate with each other, which is equivalent to the two machines connected by twisted pair wires .


personally, the adoption of host-only is not to communicate with the external network to ensure security. but isn't host-only going to be able to set up access to the Internet? The answer is that you can set up access to the Internet.

You can take advantage of the Internet Connection Sharing in Windows (which is actually a simple routing nat) to allow the virtual machine to access the virtual system's TCP/IP configuration information (such as the DNS server of the address gateway addresses) via the host's real network card. are dynamically allocated by the DHCP server of the VirtualBox host-only virtual network.


2 VirtualBox knowledge Point supplementHere is a demonstration example of installing the Linux Redflag operating system with VirtualBox. Knowledge Point 1:virtualbox can make up to four NICs per Linux guest.
Knowledge point 2: If guest is installed, but no network card is configured for it. Then the guest does not have the corresponding NIC eth0, etc., so the virtual machine and the host or other host on thethe virtual machine communicates. Knowledge point 3: If you want to configure a NIC for a guest that is already installed, turn off the guest first.


3 host-only Intranet mode3.1 VirtualBox on the client to prepare Host-onlyOn the VirtualBox to configure the network card for the virtual machine, as well as the configuration of the network card attach to the point (there is Nat,bridge adapter,host-only adapter, etc.), here only selecthost-only Adapter.
when the configuration is ready, start the corresponding virtual machine. You will find that there is a corresponding NIC eth0 on the virtual machine. If you want to formulate a eth1 again, you need to enable a network card. this time, you will find a VirtualBox host-only Nic added to Windows.
from the Windows window, you can also see:
3.2 Test the connection between the virtual machine and the host. now the virtual machine and the host can be ping through. between a virtual machine and a virtual machine, we clone or install a virtual machine (I use another Fedora OS installation) and find that the virtual machines can ping each other. Note: The IP of the virtual machine and the host's VirtualBox host-only network card configuration only need to be in the same network segment, it can be interoperable.
It is known that virtual machines can communicate with each other, so what about the virtual machine guest and the network outside of the host? test by pinging the www.baidu.com. practice proves that it is not possible to ping through.
4 host-only External network mode4.1 Homestay Host Configurationon Windows Settings, let the Host-only network card share the network card on the Windows host to surf the Internet:Right-to- property-->sharing-->select first allow-->choose VirtualBox host-only network
after sharing, then to see the VirtualBox host-only network card, is set to the default IP (192.168.137.1), if you do not want to use the IP, you can modify it,I changed it here to 192.168.56.101, formulated
Note that the IP here is in the same network segment as the virtual guest's IP. and the default gateway for guest, to be set to this IP.
set the network configuration for the local network adapter to get automatically, note: This step does not have to be done. You can also skip Oh.
Now that the settings on Windows are basically complete, the next step is to set up a Linux virtual machine.


4.2 Make the preparation on the VirtualBox. Use your own DHCP service: First stop VirtualBox's own DHCP service and make the DHCP service more uniform.
to stop the DHCP service on VirtualBox:on VirtualBox: file-->preferences-->network-->host-only networks--> screwdriver-->dhcp server--> Cancel the Enable Server

4.3 Configure the network environment on the virtual machine:To Add a default gateway:route add default GW 192.168.56.101Note: 192.168.56.101 is the IP address on the host-only NIC on the Windows host. To Configure a DNS server:vim/etc/resolv.cnfnameserver 150.236.34.180Note: 150.236.34.180 and DNS servers on Windows are consistent. methods for how to check DNS: On Windows:ipconfig/all to Sisu the network, the default gateway and DNS configuration is required to be correct and essential!
4.4 Test:Ping www.baidu.comtest Result: OK.

















VirtualBox Host-only Understanding and practice

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.