Skip to content

Ops 301 Class 08

Bill Kachersky edited this page Oct 4, 2021 · 1 revision

VirtualBox Network Settings: Complete Guide


Networking is inseparably part of modern business. Without networks to exchange data over, computers wouldn't hold nearly as much value in the modern world as they do presently. Hardware virtualization is all about exploring how we can use virtual machines in nearly every instance where a physical computer could be used. Because networking is such an indispensable part of modern business, for virtual machines to retain their usefulness in the digital space, they must be able to connect to physical and virtual networks with their virtual adapters. In VirtualBox, virtual machines can be connected to different networks. The modes provided by VirtualBox are as follows;

  • Not Attached
  • NAT
  • NAT Network
  • Bridged Adapter
  • Internal Network
  • Host-Only Network
  • Generic Driver

How do Virtual Network Adapters Work?

A VM in VirtualBox is capable of using up to eight virtual network adapters, referred to as a Network Interface Controller (NIC). Four virtual network adapters can be configured in the VirtualBox GUI for a VM by clicking "Settings" and going to the "Network" section of the settings window. If you were to navigate there, you'd see 4 adapter tabs, the first one is always enabled by default once a VM has been created. There's a checkbox to enable or disable the adapter called "Enable Network Adapter". There is also a nested menu under "Advanced" that can be opened by clicking the arrow to the left of it. In the "Advanced" settings, you will be able to select the various types of virtual network adapters available in VirtualBox. They are as follows;

AMD PCnet-PCI II (Am79C970A). This network adapter is based on AMD chip and can be used in many situations. As for Windows guests, this network adapter can be used for older Windows versions (such as Windows 2000) because newer Windows versions such as Windows 7, 8 and 10 do not contain a built-in driver for this adapter. Originally, the Am79C970A PCI device contained a single chip 10-Mbit controller and the DMA engine was integrated. This network adapter also supports AMD’s Magic Packet technology for remote wake-up.

AMD PCnet-FAST III (Am79C973). This virtualized network adapter is supported by almost all guest operating systems that can run on VirtualBox. GRUB (the boot loader) can use this adapter for network boot. Similarly to the previous network adapter, this one is based AMD chip.

Intel PRO/1000 MT Desktop (82540EM). This adapter works perfectly with Windows Vista and newer Windows versions. The most of Linux distributions support this adapter as well.

Intel PRO/1000 T Server (82543GC). Windows XP recognizes this adapter without installing additional drivers.

Intel PRO/1000 MT Server (82545EM). This adapter model is useful to import OVF templates from other platforms and can facilitate import process. Paravirtualized Network Adapter (virtio-net) is a special case. Instead of virtualizing networking hardware that is supported by most operating systems, a guest operating system must provide a special software interface for virtualized environments. This approach allows you to avoid the complexity of networking hardware emulating and, as a result, can improve network performance.

VirtualBox provides limited support for Jumbo frames (1.) If you need to use jumbo frames, you'll need to select one of the Intel adapters and set it Bridged Mode. The AMD adapters in VirtualBox do not support jumbo frames and as a result will silently drop them for input and output traffic. By default, jumbo frames are disabled.

VirtualBox Network Modes

One of the most interesting parts of the virtual adapter settings in VirtualBox is being able to employ the variety of modes on the adapters, and particuarly to be able to specify a different mode for each adapter in a single VM. The modes are, in detail:

  • Not attached

A virtual network adapter is installed in a VM, but the network connection is missing, much like when you unplug the Ethernet network cable when using a physical network adapter. This mode can be useful for testing.

  • NAT

This is the default network mode enabled when you create a new VM. A guest operating system on a VM can access hosts in a physical local area network (LAN) by using a virtual NAT (Network Address Translation) device. External networks, including the internet, are accessible from a guest OS. A guest machine is not accessible from a host machine, or from other machines in the network when the NAT mode is used.

  • NAT Network

This mode is similar to the NAT mode that you use for configuring a router. If you use the NAT Network mode for multiple virtual machines, they can communicate with each other via the network. The VMs can access other hosts in the physical network and can access external networks including the internet. Any machine from external networks as well as those from a physical network to which the host machine is connected cannot access the VMs configured to use the NAT Network mode. The host machine cannot access the guest machines either.

  • Bridged Adapter

This mode is used for connecting the virtual network adapter of a VM to a physical network to which a physical network adapter of the VirtualBox host machine is connected. A VM virtual network adapter uses the host network interface for a network connection. Put simply, network packets are sent and received directly from/to the virtual network adapter without additional routing.

  • Internal Network

Virtual machines whose adapters are configured to work in the VirtualBox Internal Network mode are connected to an isolated virtual network. VMs connected to this network can communicate with each other, but they cannot communicate with a VirtualBox host machine, or with any other hosts in a physical network or in external networks. VMs connected to the internal network cannot be accessed from a host or any other device. The VirtualBox internal network can be used for modeling real networks.

  • Host-only Adapter

This network mode is used for communicating between a host and guests. A VM can communicate with other VMs connected to the host-only network, and with the host machine. The VirtualBox host machine can access all VMs connected to the host-only network.

  • Generic Driver

This network mode allows you to share the generic network interface. A user can select the appropriate driver to be distributed in an extension pack or be included with VirtualBox.

Two sub-modes are available for VirtualBox Generic Driver mode – UDP Tunnel and VDE (Virtual Distributed Ethernet) Networking.

UDP Tunnel. Virtual machines that run on different hosts can communicate transparently by using an existing network infrastructure.

VDE Networking. Virtual machines can connect to a virtual distributed switch on Linux or FreeBSD hosts. You need to compile VirtualBox from sources to use VDE networking since standard VirtualBox packages don’t include this feature.

Port Forwarding

Port forwarding is a process of intercepting traffic addressed to the appropriate IP address and port in addition to redirecting that traffic to a different IP address and/or port. Special applications can be used on computers and other router devices to configure port forwarding. One of the most popular use cases for port forwarding is by providing access to particular network services that are hidden behind the NAT from external networks. After configuring port forwarding rules, clients can access the appropriate services from outside by connecting to the router’s (host’s) external IP address and specified port.

The packets are first intercepted by an application on the router, then the application reads the destination IP address and port number of the appropriate headers (IP packet headers, headers of TCP or UDP segments). If a combination of the destination IP address and/or port number in headers matches a condition set in a port forwarding rule, the routing application rewrites the header information (IP address and/or port number) and sends a packet/segment to another network interface according to the port forwarding rule.

By default, connecting to VirtualBox VMs whose network adapters are set to operate in the NAT or NAT Network mode is impossible from a VirtualBox host and other hosts in LAN, but VirtualBox provides a built-in port forwarding feature to enable such access.

Two examples of this are connecting to an SSH Server running on an Ubuntu Linux VM and hosting a web server.

Cited from Nakivo


This information is extremely relevant to what we are studying in this class as it pertains to networking techniques, how to sandbox networking techniques, and how to use VirtualBox to test networking techniques and even deploy public facing web servers.

Clone this wiki locally