Network Configuration in VirtualBox
VirtualBox provides several types for virtual networks. This article will explain the differences and potential uses for the various network configurations.
- 1 overview table of access options
- 2 Virtual Network Hardware
- 3 Network Modes
- 3.1 "Not attached" mode
- 3.2 Network Address Translation (NAT)
- 3.3 NAT service
- 3.4 Bridged Networking
- 3.5 Internal Networking
- 3.6 Host-only Networking
- 3.7 Generic networking
- 4 References
- 5 Additional Information
overview table of access options
|Network type|| Access
Gast -> other Guests
Host -> Guest
Gast -> external Network
|Network Address Translation (NAT)||-||-||✔|
|Network Address Translation Service||✔||-||✔|
Virtual Network Hardware
VirtualBox 4.* provides the following virtual network cards:
- AMD PCNet PCI II (Am79C970A)
- AMD PCNet FAST III (Am79C973, the default)
- Intel PRO/1000 MT Desktop (82540EM)
- Intel PRO/1000 T Server (82543GC)
- Intel PRO/1000 MT Server (82545EM)
- Paravirtualized network adapter (virtio-net)
For network configuration, VirtualBox 4.* provides the following network modes:
- "Not attached" mode (not connected)
- Network Address Translation (NAT)
- Bridged networking (network bridge)
- Internal networking (internal network)
- Host-only networking (Host-only adapter)
- Generic networking
"Not attached" mode
In this mode, the guest system will see a network card, whose (virtual) cable has been disconnected.
Network Address Translation (NAT)
NAT is the simplest option from the point of view of the guest system for accessing external networks. External access to the guest system (such as accessing a web server installed on a guest system) is not possible.
Note: Even from the host system, the services on the guest system cannot be accessed. If access should be possible, an additional interface can be configured using Host-only networking.
Network Address Translation Service is a new NAT variant, which was newly introduced (experimental) with VirtualBox 4.3. The functionality is similar to a router. Direct access to the client systems from outside the network is prevented and the guest systems can communicate with TCP and UDP over IPv4 and IPv6 to each other and to the outside world. The NAT service is connected to an internal network. Virtual machines using this service should be connected to this internal network. The name of the internal network is selected when configuring the NAT service. The internal network will be recreated if it does not already exist.
Example configuration of a static NAT network
VBoxManage natnetwork add -t nat-int-network -n "192.168.15.0/24" -e
natnetwork is the name of the internal network.
192.168.15.0/24 represents the network and subnet mask.
192.168.15.1 is the gateway address.
Example configuration with DHCP server
VBoxManage natnetwork add -t nat-int-network -n "192.168.15.0/24" -e -h on
Adding a DHCP server later
VBoxManage natnetwork modify -t nat-int-network -h on
For more information and configuration options, see Network Address Translation Service (Virtualbox Manual).
In this mode, the guest system will receive direct access to the network, to which the host system has been connected.
Only those guest systems that have been connected to the same internal network will be able to communicate with each other in the internal network configuration. Communication with the host system or another network outside of VirtualBox will not be possible.
In this mode, communication between connected guest systems and the host system is possible.
Customized network interfaces will be used on the host system for the host-only network, such as:
vboxnet0. The IP address on the host as well as the DHCP server for this network will be configured directly in VirtualBox:
The following table shows the host-only network configuration used in this example:
|IP address for the host||192.168.56.1 (network mask 255.255.255.0)|
|DHCP-Server Range||192.168.56.101 - 192.168.56.254|
|The IP range limiting the IP addresses that will be provided to the guest systems||192.168.56.2 - 192.168.56.100|
Für den Generic networking Modus gibt es aktuell zwei mögliche Sub-Modes:
- Oracle VirtualBox User Manual (Virtual networking hardware section)
- Oracle VirtualBox Users Manual (Introduction to Networking Modes section)
- Sun VirtualBox User Manual ("Not Attached" Mode Section)
- Oracle VirtualBox User Manual (Network Address Translation (NAT) section
- Oracle VirtualBox User Manual (Bridged networking section)
- Oracle VirtualBox User Manual (Internal networking section)
- Oracle VirtualBox User Manual (Host-only networking section)
- Oracle VirtualBox User Manual (UDP Tunnel networking section)
- Oracle VirtualBox User Manual (VDE networking section)
- Oracle VirtualBox User Manual (Chapter 6. Virtual networking)
Author: Werner Fischer
Werner Fischer, working in the Web Operations & Knowledge Transfer team at Thomas-Krenn, completed his studies of Computer and Media Security at FH Hagenberg in Austria. He is a regular speaker at many conferences like LinuxTag, OSMC, OSDC, LinuxCon, and author for various IT magazines. In his spare time he enjoys playing the piano and training for a good result at the annual Linz marathon relay.