6 Virtual networking

any reason, you prefer two or more VMs on the same machine to communi- cate privately, hiding their data from both the host system and the user, bridged networking therefore is not an option.

2.Speed. Internal networking is more efficient than bridged networking, as VirtualBox can directly transmit the data without having to send it through the host operating system’s networking stack.

Internal networks are created automatically as needed, i.e. there is no central con- figuration. Every internal network is identified simply by its name. Once there is more than one active virtual network card with the same internal network ID, the VirtualBox support driver will automatically “wire” the cards and act as a network switch. The VirtualBox support driver implements a complete Ethernet switch and supports both broadcast/multicast frames and promiscuous mode.

In order to attach a VM’s network card to an internal network, set its networking mode to “internal networking”. There are two ways to accomplish this:

You can use a VM’s “Settings” dialog in the VirtualBox graphical user interface. In the “Networking” category of the settings dialog, select “Internal Networking” from the drop-down list of networking modes. Now select the name of an exist- ing internal network from the drop-down below or enter a new name into the entry field.

You can use VBoxManage modifyvm <VM name> --nic<x> intnet. Op- tionally, you can specify a network name with the command VBoxManage modifyvm <VM name> --intnet<x> <network name>. If you do not specify a network name, the network card will be attached to the network intnet by default.

Unless you configure the (virtual) network cards in the guest operating systems that are participating in the internal network to use static IP addresses, you may want to use the DHCP server that is built into VirtualBox to manage IP addresses for the internal network. Please see chapter 8.26, VBoxManage dhcpserver, page 133 for details.

As a security measure, the Linux implementation of internal networking only allows VMs running under the same user ID to establish an internal network.

6.6 Host-only networking

Host-only networking is another networking mode that was added with version 2.2 of VirtualBox. It can be thought of as a hybrid between the bridged and internal net- working modes: as with bridged networking, the virtual machines can talk to each other and the host as if they were connected through a physical ethernet switch. Sim- ilarly, as with internal networking however, a physical networking interface need not be present, and the virtual machines cannot talk to the world outside the host since they are not connected to a physical networking interface.

94

Page 94
Image 94
Sun Microsystems VERSION 3.1.0_BETA2 user manual Host-only networking