Exploring VirtualBox Networking and Understanding Cloud Networking
Mohamad's interest is in Programming (Mobile, Web, Database and Machine Learning). He is studying at the Center For Artificial Intelligence Technology (CAIT), Universiti Kebangsaan Malaysia (UKM).
Introduction
Before learning cloud networking technologies such as AWS VPC, Azure Virtual Network, and Google Cloud VPC, it is useful to understand how virtual machines communicate with each other and with external networks.
VirtualBox provides several networking modes that simulate real-world networking scenarios. By experimenting with these modes, students can visualize concepts that later appear in cloud networking architectures.
In this tutorial, you will create two virtual machines and observe how different VirtualBox networking modes affect connectivity.
Lab Environment
Host Computer:
- Windows 11
Virtual Machines:
Xubuntu VM 1
Xubuntu VM 2
Tools:
VirtualBox
Terminal
ping command
ip addr command
Part 1: NAT Mode
Configure NAT
Shutdown the VM.
Open VirtualBox.
Select VM.
Settings → Network.
Adapter 1:
Enable Network Adapter
Attached To: NAT
Start the VM.
Check IP address:
ip addr
Expected:
10.0.2.x
Test Internet access:
ping google.com
Observation
The VM can:
Access the Internet
Download software
Browse websites
The VM cannot:
- Receive inbound connections from other devices
Cloud Networking Analogy
NAT Mode is similar to:
Private EC2 instance accessing Internet through NAT Gateway
Private Azure VM using NAT Gateway
Private subnet with outbound-only access
Concept learned:
Private Network
|
NAT Gateway
|
Internet
Part 2: Bridged Adapter
Configure Bridged Mode
Shutdown VM.
Change Adapter 1:
Attached To:
Bridged Adapter
Start VM.
Check IP:
ip addr
Expected:
192.168.x.x
same network as your home router.
Test from Windows:
ping <vm-ip>
Observation
The VM appears as a real device on the LAN.
Cloud Networking Analogy
Equivalent to:
VM with Public IP
EC2 Instance with Elastic IP
Azure VM with Public IP
Concept:
Internet
|
Public IP
|
Virtual Machine
Part 3: Host-Only Adapter
Configure:
Attached To:
Host-Only Adapter
Start VM.
Expected IP:
192.168.56.x
Test:
Windows Host → VM
Works.
VM → Internet
Fails.
Cloud Networking Analogy
Equivalent to:
Private Subnet
Backend Network
Internal Management Network
Concept:
Administrator
|
Private Network
|
Backend Servers
Part 4: Internal Network
Create two VMs.
Configure both:
Attached To:
Internal Network
Use network name:
lab-net
Assign IPs:
VM1:
sudo ip addr add 10.10.10.1/24 dev enp0s3
VM2:
sudo ip addr add 10.10.10.2/24 dev enp0s3
Test:
ping 10.10.10.2
Observation
VMs communicate with each other.
No Internet.
Host cannot access them.
Cloud Networking Analogy
Equivalent to:
Isolated subnet
Database subnet
Backend application tier
Concept:
Web Server
|
Application Server
|
Database Server
without Internet exposure.
Part 5: Network Architecture Comparison
| VirtualBox | Cloud Equivalent |
|---|---|
| NAT | NAT Gateway |
| Bridged | Public IP Instance |
| Host Only | Private Subnet |
| Internal Network | Isolated Subnet |
| Multiple Adapters | Multi-Homed Cloud VM |
What Students Learned
After this tutorial students understand:
Public vs Private networking
Network isolation
NAT concepts
Multi-tier architecture
Cloud subnet design
These concepts directly prepare students for AWS VPC, Azure VNet, and GCP VPC networking.