Network Configuration in VirtualBox - Thomas-Krenn-Wiki-en (2024)

VirtualBox provides several types for virtual networks. This article will explain the differences and potential uses for the various network configurations.

Contents

  • 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.3.1 Example configuration of a static NAT network
      • 3.3.2 Example configuration with DHCP server
      • 3.3.3 Adding a DHCP server later
    • 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 typeAccess
Guest -> other Guests
Access
Host -> Guest
Access
Guest -> external Network
Not attached---
Network Address Translation (NAT)--
Network Address Translation Service-
Bridged networking
Internal networking--
Host-only networking-

Virtual Network Hardware

VirtualBox 4.* provides the following virtual network cards:[1]

  • 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)

Network Modes

For network configuration, VirtualBox 4.* provides the following network modes:[2]

  • "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.[3]

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.[4]

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.

NAT service

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).

Bridged Networking

In this mode, the guest system will receive direct access to the network, to which the host system has been connected.[5]

Internal Networking

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.[6]

Host-only Networking

In this mode, communication between connected guest systems and the host system is possible.[7]

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:

  • Step 1: Select Global Settings from the File menu

  • Step 2: Select the Network item in the list on the left and then right-click on the tool icon.

  • Step 3: The IP address for the host can now be changed in this host-only network

  • Step 4: After clicking on the DHCP Server tab, the DHCP server settings can be changed

The following table shows the host-only network configuration used in this example:

DescriptionIP(s)
IP address for the host192.168.56.1 (network mask 255.255.255.0)
DHCP-Server Range192.168.56.101 - 192.168.56.254
The IP range limiting the IP addresses that will be provided to the guest systems192.168.56.2 - 192.168.56.100

Generic networking

There are currently two possible sub-modes for Generic networking mode:

  • UDP Tunnel[8]
  • VDE (Virtual Distributed Ethernet) networking[9]

References

  1. Oracle VirtualBox User Manual (Virtual networking hardware section)
  2. Oracle VirtualBox Users Manual (Introduction to Networking Modes section)
  3. Sun VirtualBox User Manual ("Not Attached" Mode Section)
  4. Oracle VirtualBox User Manual (Network Address Translation (NAT) section
  5. Oracle VirtualBox User Manual (Bridged networking section)
  6. Oracle VirtualBox User Manual (Internal networking section)
  7. Oracle VirtualBox User Manual (Host-only networking section)
  8. Oracle VirtualBox User Manual (UDP Tunnel networking section)
  9. Oracle VirtualBox User Manual (VDE networking section)

Additional Information

Author: Werner Fischer

Werner Fischer, working in the 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.

Network Configuration in VirtualBox - Thomas-Krenn-Wiki-en (2024)
Top Articles
Latest Posts
Article information

Author: Barbera Armstrong

Last Updated:

Views: 5469

Rating: 4.9 / 5 (79 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.