Skip to main content

Module 15 – BONUS: Network Cards in VirtualBox and VMware

+==============================================================================+
| MODULE 15 (BONUS): NETWORK CARDS – VIRTUALBOX vs VMWARE |
| Estimated Duration: 30-45 minutes | Level: Beginner to Intermediate |
+==============================================================================+

Table of Contents​

  1. Why multiple network cards?
  2. Network card types in VirtualBox (Oracle)
  3. Network card types in VMware
  4. Comparison table: VirtualBox vs VMware
  5. Practical examples from labs
  6. How to configure cards in VirtualBox
  7. How to configure cards in VMware
  8. Visual summary
  9. FAQ – Frequently Asked Questions

Why multiple network cards?​

In a virtualization lab, a single network card is not always enough. We often need to separate uses:

NeedExampleCard type
Internet access (download packages, updates)apt update, dnf installNAT
Communication between VMs (isolated private network)Server ↔ Client on 10.11.12.0/24Internal Network / Custom VMnet
Access from the host machine (SSH from your PC)SSH to the VM from the host terminalHost-Only
Simple analogy

Imagine your VM as an apartment:

  • NAT = the front door to the Internet (you go out, but no one can enter directly)
  • Internal Network = an internal hallway between apartments (VMs talk to each other, but no one from outside sees this hallway)
  • Host-Only = an intercom with the concierge (your host PC can talk to the VM, but not the Internet)
  • Bridged = you are directly on the sidewalk (your VM is visible like a real PC on the physical network)

Back to table of contents


Network card types in VirtualBox (Oracle)​

VirtualBox offers 5 main modes of network connection. Here is each explained simply:

1) NAT (Network Address Translation)​

┌─────────────┐         ┌──────────────────┐         ┌──────────┐
│ VM │ ──NAT──▶│ Host machine │ ───────▶│ Internet │
│ 10.0.2.15 │ │ (does the translation)│ │ │
└─────────────┘ └──────────────────┘ └──────────┘
FeatureDetail
Internet access from the VM✅ Yes
Access to the VM from the host❌ No (except port forwarding)
Communication between VMs❌ No (each VM has its own isolated NAT)
Assigned IP10.0.2.15 (automatic, by VirtualBox's internal DHCP)
Use caseDownload packages, browse the Internet
What is NAT?

NAT is like a translator. Your VM uses your host PC's IP address to go on the Internet. From the outside, only your PC is visible, not the VM.

2) NAT Network​

┌──────────┐     ┌──────────┐
│ VM 1 │ │ VM 2 │
│ 10.0.2.4 │ │ 10.0.2.5 │
└────┬─────┘ └────┬─────┘
│ │
└───────┬────────┘
│
┌────────▼────────┐ ┌──────────┐
│ NAT Network │ ───────▶│ Internet │
│ (shared NAT) │ │ │
└─────────────────┘ └──────────┘
FeatureDetail
Internet access from the VM✅ Yes
Access to the VM from the host❌ No (except port forwarding)
Communication between VMs✅ Yes (if same NAT network)
Assigned IPInternal DHCP (e.g., 10.0.2.4, 10.0.2.5)
Use caseVMs that need to communicate with each other AND access the Internet
Difference NAT vs NAT Network
  • NAT: each VM is isolated in its own NAT "bubble" → VMs do not see each other
  • NAT Network: all VMs share the same NAT network → VMs can communicate with each other

3) Bridged Adapter​

┌──────────┐     ┌──────────┐     ┌──────────────┐
│ VM │ │ PC │ │ Other PCs │
│192.168.1.│ │192.168.1.│ │ on the │
│ 50 │ │ 10 │ │ physical net │
└────┬─────┘ └────┬─────┘ └──────┬───────┘
│ │ │
└───────────┬────┴───────────────────┘
│
┌────────▼────────┐
│ Switch/Router │
│ real network │
└─────────────────┘
FeatureDetail
Internet access from the VM✅ Yes
Access to the VM from the host✅ Yes
Communication between VMs✅ Yes
Visible on the physical network✅ Yes (the VM gets an IP from the real router)
Assigned IPBy the physical network's DHCP (e.g., 192.168.1.50)
Use caseServer accessible from the entire local network
Warning

In Bridged mode, your VM is visible to everyone on the physical network. Do not use on a public network (café Wi-Fi, school) without precautions.

4) Internal Network​

┌──────────┐     ┌──────────┐
│ VM 1 │ │ VM 2 │
│10.11.12.1│ │10.11.12.2│
└────┬─────┘ └────┬─────┘
│ │
└───────┬────────┘
│
┌────────▼────────┐
│ Internal Network│ ❌ No Internet access
│ "intnet" │ ❌ No host access
└─────────────────┘
FeatureDetail
Internet access from the VM❌ No
Access to the VM from the host❌ No
Communication between VMs✅ Yes (if same internal network name)
Assigned IPManual (no automatic DHCP)
Use caseIsolated labs, private networks between VMs, topology simulation
Internal network name

When you configure an Internal Network in VirtualBox, you give it a name (e.g., intnet, lan, clientnet). Only VMs with the same internal network name can communicate with each other.

5) Host-Only Adapter​

┌──────────┐     ┌──────────────┐
│ VM │ │ Host │
│192.168.56│ │ machine │
│ .101 │ │192.168.56.1 │
└────┬─────┘ └──────┬───────┘
│ │
└────────┬─────────┘
│
┌─────────▼─────────┐
│ Host-Only Network│ ❌ No Internet access
│ vboxnet0 │
└───────────────────┘
FeatureDetail
Internet access from the VM❌ No
Access to the VM from the host✅ Yes
Communication between VMs✅ Yes (if same host-only network)
Assigned IPVirtualBox DHCP or manual (default range 192.168.56.0/24)
Use caseSSH from the host to the VM, access a web server on the VM from the host
When to use Host-Only?

Do you want to be able to ssh user@192.168.56.101 from your Windows/Mac/Linux host terminal? → Host-Only is made for that!

VirtualBox Summary: 5 modes in a table​

ModeInternetHost → VMVM ↔ VMPhysical networkIP
NAT✅❌❌❌10.0.2.15 (auto)
NAT Network✅❌✅❌Internal DHCP
Bridged✅✅✅✅Real network IP
Internal Network❌❌✅❌Manual
Host-Only❌✅✅❌192.168.56.x

Back to table of contents


Network card types in VMware​

VMware (Workstation / Player / Fusion) uses virtual networks called VMnet. Here are the main ones:

1) NAT (VMnet8)​

┌──────────┐         ┌──────────────┐         ┌──────────┐
│ VM │──VMnet8─▶│ Host machine │────────▶│ Internet │
│ │ │ (NAT) │ │ │
└──────────┘ └──────────────┘ └──────────┘
FeatureDetail
Virtual networkVMnet8 (default)
Internet access✅ Yes
Host → VM access✅ Yes (via VMnet8 network)
VM ↔ VM✅ Yes (if same VMnet8)
Assigned IPVMware DHCP (e.g., 192.168.128.x)
Difference with VirtualBox NAT

VMware's NAT (VMnet8) is more permissive than VirtualBox's:

  • VMware: the host can access the VM via the VMnet8 network
  • VirtualBox: the host cannot access the VM in simple NAT (port forwarding is needed)

2) Bridged (VMnet0)​

┌──────────┐     ┌──────────────┐     ┌──────────┐
│ VM │ │ Host machine │ │ Physical │
│ │ │ │ │ network │
└────┬─────┘ └──────┬───────┘ └────┬─────┘
│ │ │
└────────┬─────────┴───────────────────┘
│
┌─────────▼─────────┐
│ VMnet0 (Bridged) │
│ = physical card │
└───────────────────┘
FeatureDetail
Virtual networkVMnet0 (default)
Internet access✅ Yes
Visible on the physical network✅ Yes
Assigned IPBy the physical network's DHCP

Identical to VirtualBox's Bridged mode.

3) Host-Only (VMnet1)​

┌──────────┐     ┌──────────────┐
│ VM │ │ Host machine │
│ │ │ │
└────┬─────┘ └──────┬───────┘
│ │
└────────┬─────────┘
│
┌─────────▼─────────┐
│ VMnet1 │ ❌ No Internet access
│ (Host-Only) │
└───────────────────┘
FeatureDetail
Virtual networkVMnet1 (default)
Internet access❌ No
Host → VM access✅ Yes
VM ↔ VM✅ Yes (if same VMnet1)

Identical to VirtualBox's Host-Only mode.

4) Custom VMnet (VMnet2, VMnet3, ..., VMnet19)​

This is VMware's strength: you can create up to 20 virtual networks (VMnet0 to VMnet19), each with its own settings.

┌──────────┐     ┌──────────┐           ┌──────────┐     ┌──────────┐
│ VM A │ │ VM B │ │ VM C │ │ VM D │
└────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │ │
└───────┬────────┘ └───────┬────────┘
│ │
┌────────▼────────┐ ┌─────────▼────────┐
│ VMnet2 │ │ VMnet3 │
│ (LAN network) │ │ (Client network)│
└─────────────────┘ └──────────────────┘
FeatureDetail
Virtual networkVMnet2 to VMnet19 (customizable)
Internet accessConfigurable (NAT or not)
VM ↔ VM✅ Yes (if same VMnet)
DHCPConfigurable in Virtual Network Editor
Equivalent to VirtualBox's Internal Network

A custom VMnet without NAT and without host connection is VMware's equivalent to VirtualBox's Internal Network. Example: VMnet2 configured as "Host-only" without host connection = isolated network between VMs.

5) LAN Segment​

The LAN Segment is a completely isolated network, without DHCP, without host connection, without NAT.

FeatureDetail
Internet access❌ No
Host → VM access❌ No
VM ↔ VM✅ Yes (if same LAN Segment)
DHCP❌ No (manual IP only)
LAN Segment vs Internal Network (VirtualBox)

The LAN Segment in VMware is the closest equivalent to VirtualBox's Internal Network: a completely isolated network, manual IPs, only between VMs.

VMware Summary: the VMnets​

VMnetModeInternetHost → VMVM ↔ VMNotes
VMnet0Bridged✅✅✅Connected to the physical network
VMnet1Host-Only❌✅✅Private network with the host
VMnet8NAT✅✅✅NAT via the host
VMnet2-7, 9-19CustomConfigurableConfigurable✅Custom networks
LAN SegmentIsolated❌❌✅Like Internal Network

Back to table of contents


Comparison table: VirtualBox vs VMware​

Direct correspondence​

FunctionVirtualBoxVMware
Internet access via hostNATNAT (VMnet8)
Internet + communication between VMsNAT NetworkNAT (VMnet8)
VM on the physical networkBridged AdapterBridged (VMnet0)
Private network with hostHost-Only AdapterHost-Only (VMnet1)
Isolated network between VMsInternal NetworkLAN Segment or Custom VMnet
Multiple custom networksInternal Network (named)Custom VMnet (VMnet2-19)

Key differences​

CriterionVirtualBoxVMware
Max number of cards per VM4 (GUI) or 8 (CLI)10
Max number of internal networksUnlimited (by name)20 (VMnet0 to VMnet19)
NAT: can host access the VM?❌ No (port forwarding needed)✅ Yes (via VMnet8)
DHCP in internal network❌ No (manual IP required)Configurable by VMnet
Virtual network editorLimited✅ Virtual Network Editor (advanced)
Network performanceGoodVery good (VMXNET3)

Back to table of contents


Practical examples from labs​

Example 1: Lab 4 – SSH (2 cards per VM)​

In Lab 4 (SSH Protocol), each VM uses 1 network card in Internal Network:

┌──────────────────────────────────────────────────┐
│ Internal Network "intnet" │
│ 10.11.12.0/24 │
│ │
│ ┌────────────┐ ┌────────────┐ │
│ │ SSH-SRV │ │ SSH-CLI │ │
│ │ │ │ │ │
│ │ Adapter 1: │ │ Adapter 1: │ │
│ │ Internal │◄────────►│ Internal │ │
│ │ Network │ │ Network │ │
│ │ "intnet" │ │ "intnet" │ │
│ │ 10.11.12.1 │ │ 10.11.12.2 │ │
│ └────────────┘ └────────────┘ │
└──────────────────────────────────────────────────┘

Configuration in VirtualBox:

VMAdapter 1
SSH-SRVInternal Network → intnet (manual IP: 10.11.12.1/24)
SSH-CLIInternal Network → intnet (manual IP: 10.11.12.2/24)

VMware equivalent:

VMNetwork Adapter 1
SSH-SRVLAN Segment → intnet (manual IP: 10.11.12.1/24)
SSH-CLILAN Segment → intnet (manual IP: 10.11.12.2/24)
Why no NAT in Lab 4?

This lab does not need Internet. The two VMs communicate only with each other on the internal network. If you need to install packages, temporarily add a NAT card, install, then remove it.


Example 2: Lab 5 – SSH, HTTP, and Firewall (up to 3 cards)​

In Lab 5 (SSH, HTTP, and Firewall), srvGateway uses 3 network cards:

                        ┌──────────────────────────────────┐
│ srvGateway │
│ │
│ Adapter 1: NAT (Internet) │
│ Adapter 2: Internal "lan" │
│ 10.11.12.1/24 │
│ Adapter 3: Internal "clientnet" │
│ 20.21.22.1/30 │
└───┬──────────┬──────────┬────────┘
│ │ │
Internet│ LAN │ Client│
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐
│ srvSSH │ │ Client │
│ srvWEB │ │20.21.22.2│
│10.11.12.x│ └──────────┘
└──────────┘

Configuration in VirtualBox:

VMAdapter 1Adapter 2Adapter 3
srvGatewayNAT (Internet)Internal Network → lanInternal Network → clientnet
srvSSHInternal Network → lan——
srvWEBInternal Network → lan——
ClientInternal Network → clientnet——

VMware equivalent:

VMNetwork Adapter 1Network Adapter 2Network Adapter 3
srvGatewayNAT (VMnet8)Custom → VMnet2 (lan)Custom → VMnet3 (clientnet)
srvSSHCustom → VMnet2 (lan)——
srvWEBCustom → VMnet2 (lan)——
ClientCustom → VMnet3 (clientnet)——
Why 3 cards on srvGateway?

Each card has a specific role:

  1. NAT → Internet access (for apt update, downloads)
  2. Internal lan → server network (10.11.12.0/24)
  3. Internal clientnet → client network (20.21.22.0/30)

The srvGateway machine does the routing between these 3 networks using ip_forward and iptables.


Example 3: Lab with 3 cards (NAT + NAT Network + Host-Only)​

Here is another common case: a VM that needs Internet, to communicate with other VMs, AND to be accessible from the host:

VirtualBox Configuration:

AdapterModeRoleTypical IP
Adapter 1NATInternet access10.0.2.15 (automatic)
Adapter 2NAT Network (NatNetwork1)Communication between VMs + Internet10.0.2.x (DHCP)
Adapter 3Host-Only (vboxnet0)SSH access from the host192.168.56.x

VMware equivalent:

AdapterModeRoleTypical IP
Network Adapter 1NAT (VMnet8)Internet access + host192.168.128.x
Network Adapter 2Custom (VMnet2)Communication between VMsManual IP
Network Adapter 3Host-Only (VMnet1)SSH access from the host192.168.xxx.x

Back to table of contents


How to configure cards in VirtualBox​

Step by step (GUI)​

  1. Select the VM → Click on Settings
  2. Go to Network
  3. You see the tabs Adapter 1, Adapter 2, Adapter 3, Adapter 4
  4. For each adapter:
    • Check Enable Network Adapter
    • Choose the mode in the Attached to dropdown (Network access mode)

Configuration for each mode​

NAT​

☑ Enable Network Adapter
Attached to: NAT

Nothing else to configure. VirtualBox handles everything automatically.

Internal Network​

☑ Enable Network Adapter
Attached to: Internal Network
Name: intnet ← type the network name (VMs with the same name see each other)
Important

You must configure the IP manually in the VM (no DHCP):

# Example on Ubuntu (netplan file)
sudo nano /etc/netplan/01-netcfg.yaml
network:
version: 2
ethernets:
enp0s8: # interface name (check with "ip a")
addresses:
- 10.11.12.1/24
sudo netplan apply

Host-Only​

☑ Enable Network Adapter
Attached to: Host-only Adapter
Name: VirtualBox Host-Only Ethernet Adapter
Create a Host-Only network

If no Host-Only network exists:

  1. Menu File → Host Network Manager
  2. Click on Create
  3. A vboxnet0 network is created with the range 192.168.56.0/24

NAT Network​

☑ Enable Network Adapter
Attached to: NAT Network
Name: NatNetwork ← the shared NAT network name
Create a NAT Network
  1. Menu File → Preferences → Network
  2. Click on + to add a NAT network
  3. Give it a name (e.g., NatNetwork)

Bridged​

☑ Enable Network Adapter
Attached to: Bridged Adapter
Name: Intel(R) Wi-Fi... ← choose your physical network card

CLI Command (VBoxManage)​

For advanced users, you can configure the cards via command line:

# Adapter 1: NAT
VBoxManage modifyvm "MyVM" --nic1 nat

# Adapter 2: Internal Network named "lan"
VBoxManage modifyvm "MyVM" --nic2 intnet --intnet2 "lan"

# Adapter 3: Internal Network named "clientnet"
VBoxManage modifyvm "MyVM" --nic3 intnet --intnet3 "clientnet"

# Adapter 2: Host-Only
VBoxManage modifyvm "MyVM" --nic2 hostonly --hostonlyadapter2 "vboxnet0"

# Adapter 1: Bridged
VBoxManage modifyvm "MyVM" --nic1 bridged --bridgeadapter1 "Intel(R) Wi-Fi"

Back to table of contents


How to configure cards in VMware​

Step by step (GUI)​

  1. Select the VM → Click on Edit virtual machine settings
  2. Click on Add... to add a network adapter (or select an existing one)
  3. Choose the connection type:
    • Bridged (VMnet0)
    • NAT (VMnet8)
    • Host-only (VMnet1)
    • Custom → choose a specific VMnet

Virtual Network Editor (VMware Workstation Pro)​

The Virtual Network Editor is VMware's most powerful tool for managing networks:

  1. Menu Edit → Virtual Network Editor
  2. Click on Change Settings (admin rights)
  3. You can:
    • Create new VMnets
    • Configure DHCP per VMnet
    • Configure subnet per VMnet
    • Enable/disable NAT per VMnet
    • Connect/disconnect the host

Example: create an isolated network (equivalent to Internal Network)​

In the Virtual Network Editor:

VMnet2:
☐ Connect a host virtual adapter ← unchecked (host does not see this network)
☐ Use local DHCP service ← unchecked (manual IP)
Subnet IP: 10.11.12.0
Subnet mask: 255.255.255.0

Then in the VM:

Network Adapter → Custom → VMnet2

IP configuration in the VM​

Same procedure as VirtualBox – configure the IP manually in the VM:

# Ubuntu (netplan)
sudo nano /etc/netplan/01-netcfg.yaml
network:
version: 2
ethernets:
ens33: # VMware interface name (check with "ip a")
addresses:
- 10.11.12.1/24
sudo netplan apply

Back to table of contents


Visual summary​

Decision diagram: which card to choose?​

The 3 most common lab configurations​

┌─────────────────────────────────────────────────────────────────────┐
│ COMMON CONFIGURATION #1 │
│ "I just want Internet on my VM" │
│ │
│ → 1 card: NAT │
│ VirtualBox: Adapter 1 = NAT │
│ VMware: Network Adapter 1 = NAT (VMnet8) │
├─────────────────────────────────────────────────────────────────────┤
│ COMMON CONFIGURATION #2 │
│ "My VMs need to talk on a private network" │
│ │
│ → 2 cards: NAT + Internal Network │
│ VirtualBox: Adapter 1 = NAT, Adapter 2 = Internal "intnet" │
│ VMware: Adapter 1 = NAT, Adapter 2 = Custom VMnet2 │
├─────────────────────────────────────────────────────────────────────┤
│ COMMON CONFIGURATION #3 │
│ "My VM is a gateway between 2 private networks + Internet" │
│ │
│ → 3 cards: NAT + Internal "lan" + Internal "clientnet" │
│ VirtualBox: Adapter 1 = NAT, Adapter 2 = Internal "lan", │
│ Adapter 3 = Internal "clientnet" │
│ VMware: Adapter 1 = NAT, Adapter 2 = VMnet2, Adapter 3 = VMnet3 │
└─────────────────────────────────────────────────────────────────────┘

Back to table of contents


FAQ – Frequently Asked Questions​

Q: Maximum number of network cards per VM?​

HypervisorMaximum (GUI)Maximum (CLI/advanced)
VirtualBox48 (with VBoxManage)
VMware1010

Q: My VM has no connection between VMs, what to check?​

  1. Same network name: VMs must be on the same internal network (e.g., intnet)
  2. Manual IPs configured: in Internal Network / LAN Segment, no automatic DHCP
  3. Same subnet: IPs must be in the same network (e.g., 10.11.12.1/24 and 10.11.12.2/24)
  4. Firewall disabled (for testing): sudo ufw disable or sudo iptables -F
  5. Card enabled: check with ip a that the interface is UP

Q: How to know my interface name in the VM?​

ip a
# or
ip link show

Common names:

  • VirtualBox: enp0s3 (card 1), enp0s8 (card 2), enp0s9 (card 3)
  • VMware: ens33 (card 1), ens34 (card 2), ens35 (card 3)

Q: Can I mix VirtualBox and VMware?​

❌ No. VirtualBox VMs cannot communicate with VMware VMs via an internal network. Each hypervisor has its own isolated virtual networks.

Q: What is the difference between NAT and NAT Network in VirtualBox?​

NATNAT Network
Internet✅✅
VM ↔ VM❌ (each VM isolated)✅ (VMs on the same network)
UsageSingle VMMultiple VMs that need to communicate AND have Internet

Q: In VMware, does VMnet8 (NAT) allow VMs to see each other?​

✅ Yes! Unlike VirtualBox's simple NAT, VMware's NAT (VMnet8) allows VMs on the same VMnet8 to communicate with each other.


Bonus Lab created on: February 2026