top of page
  • Linkedin

VirtualBox Network Modes Explained: NAT, Bridged, NAT Network, Host-Only & Internal

Understanding Network Modes of VirtualBox - Bridged Adapter, NAT, NAT Network, Host-Only, and Internal - is essential for configuring virtual machines safely and effectively. Choosing the right mode determines how your VM connects to the internet, your local network, and other VMs, which directly impacts isolation and security.


For developers working in secure programming or cybersecurity, this knowledge is especially important: a simple network misconfiguration can expose test environments, leak sensitive traffic, or create unintended attack paths. By choosing the correct VirtualBox network mode, you ensure your lab setups remain controlled, isolated, and security-focused.



  1. Bridged Adapter

Diagram showing VirtualBox Bridged Adapter setup with Internet cloud, host OS, virtual bridge, and VMs. Arrows depict network flow.
Bridged Adapter Network

Your virtual machine connects to the same network as your physical computer, similar to adding another physical device to your network. It receives its own IP address from your router or DHCP server.


Select Bridge Adapter Mode

  • When you want the VM to behave like a real machine on the LAN

  • When other devices on the network must reach your VM (e.g., hosting a local server)


Let's consider,

  • Your home network is: 192.168.1.0/24

  • Your laptop's IP is 192.168.1.50, and your VM (bridged) might receive 192.168.1.120

  • Both the laptop and VM are on the same LAN and can ping each other. Other devices at home can also reach the VM.


The host on which the VM is installed, or any machine on the same LAN, can directly SSH into the VM if the VM's SSH port is open.

This will make your test environment accessible to the entire network.


  1. NAT (Default)

NAT (DEFAULT) Network
NAT (DEFAULT) Network

The VM is behind VirtualBox’s internal router. VM access the internet using the host’s connection without exposing the VM to the host network.


Select NAT(Default) Mode

  • When you want internet on the VM

  • When you DON’T need inbound connections to VM


Let's consider

  • Your machine IP = 192.168.1.50

  • VirtualBox creates a virtual NAT router inside the host.

  • Your VM is given an IP address from a private internal network (usually 10.0.2.0/24).


Typical default setup:

Component
Address

VM

10.2.2.15

Virtual NAT Gateway

10.0.2.2

DHCP Server

10.0.2.3

In short,

The VM sends traffic → NAT device → Host → Internet.


VM can Access the internet & external networks. Also, it will resolve DNS using host

You don’t need to change anything on your LAN router. Other VMs cannot reach each other or Host also can not reach VM directly.


NAT is one-way connectivity (VM → internet)


If you want to access a service running on the VM (SSH, RDP, web server), you must configure port forwarding


Step-by-step Configuration for PORT FORWARDING

On the HOST (Laptop/PC)

  • Inside VirtualBox, configure port forwarding:

  • Open VirtualBox Manager

  • Select your VM → Settings

  • Go to Network → Adapter 1 → NAT

  • Click Advanced → Port Forwarding


Add a forwarding rule:

Name

Protocol

Host IP

Host port

Guest IP

Guest Port

SSH

TCP

10.10.10.10

2222

10.0.2.15

22


Now, You can SSH to your VM by hitting below query


ssh -p 2222 user@10.0.2.15


Note that,

If you create two VMs in VirtualBox and keep them on the default NAT network mode, they cannot communicate with each other.


In VirtualBox's default NAT mode (per VM), each VM gets its own isolated NAT router.

Each VM is placed in a separate private network, even though they both use “NAT”.


To allow VM-to-VM communication, you must switch to our next network mode i.e. NAT Network.


  1. NAT Network

NAT NETWORK Mode
NAT NETWORK Mode

Similar to NAT, but for multiple VMs to communicate with each other behind the same NAT.


Select NAT Network Mode

  • When you need a Lab with multiple VMs

  • When your VMs need internet

  • When your VMs must talk to each other but not exposed to external LAN


Let's consider

  • VM1 IP = 10.0.2.15

  • VM2 IP = 10.0.2.20(both inside VirtualBox NAT Network)

  • VM1 ↔ VM2 can communicate.


Both VM will have internet. Host can't directly access them. Other LAN devices cannot reach VMs

To reach each VM independently you must configure port forwarding for both VMs as steps given here.

Another way you can access is to create port forwarding for single VM and access all other VM from that VM.


  1. Host-Only Adapter

    Host-Only Adapter Network
    Host-Only Adapter Network

A Host-Only Adapter creates a private isolated network between your Host Machine (your laptop/PC) & your Virtual Machines. This network is not connected to the internet and not connected to your LAN.


Think of it as a “virtual switch” that only your host and VMs can use.


Select Host-Only Adapter Mode

  • When you need secure testing

  • When you want Host to communicate with VM only

  • When you do not want internet or LAN exposure


Host can directly communicate with VMs

Host → VM communication works without port forwarding.

VM → Host communication also works.

Example:

ping 192.168.56.101 # From host → VM1

ssh 192.168.56.1 # From VM → host


VMs on the same Host-Only network can talk to each other

VM1 ↔ VM2 communication works like a real LAN.

ping 192.168.56.102 # From VM1 → VM2


No routing or NAT needed & no internet access by default. Host-Only is offline. NIC does not route traffic to the outside world.


  1. Internal Network

    Internal Network Mode
    Internal Network Mode

Only VMs on the same internal network name can talk to each other. Host cannot communicate with them.


Select Host-Only Adapter Mode

  • When you want Isolated VM clusters.

  • When you want to create private lab networks.


With Internal Network mode, only VMs connected to the same Internal Network name can communicate. The Host cannot communicate with these VMs. No VM is associated with internet access. VMs can only talk to each other.


It's like building a private switch that the host cannot see. Internal Network is more isolated than Host-Only.


Quick Comparison Table

Mode

VM -> Internet

VM -> LAN

Host -> VM

VM -> VM

Isolation Level

Bridged

✔️

✔️

✔️

✔️

Low

NAT

✔️

🚫

🚫 (needs port forward)

🚫

High

NAT Network

✔️

🚫

🚫

✔️

Medium High

Host-Only

🚫 (unless dual-adapter)

🚫

✔️

✔️

Very High

Internal

🚫

🚫

🚫

✔️

Maximum


This is short information about VirtualBox's Network Mode. VirtualBox gives you a whole menu of network modes, each with its own personality: NAT is the “I want internet but leave me alone” mode, NAT Network is the “let’s all chat but don’t invite the host” mode, Host-Only is the “family group chat” where only you and your VMs can talk, Internal Network is the “secret underground bunker” where only VMs are allowed, and Bridged Adapter is the “social butterfly” that jumps right onto your LAN and talks to everyone.


Pick the mode that matches your VM’s mood!


 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page