In this practical exercise, we’ll set up a basic network using VirtualBox and Ubuntu as the guest operating system.
We’ll configure two virtual machines (VMs) to represent two different networks, and configure networking between them.
This will help you understand how routers, switches, and IP addressing work in a virtualized environment.
Prerequisites:
- Virtualbox: Download virtual box for your machine. Get it here.
- Ubuntu ISO: In this example we will use ubuntu ISO to simulate a network. Search ubuntu iso and download the latest version
Create Two Virtual Machines in VirtualBox:
- Open VirtualBox and click on New to create the first virtual machine.
- Name: Ubuntu-VM1
- Type: Linux
- Version: Ubuntu (64-bit)
- Follow the on-screen prompts to configure the VM:
- Memory Size: 1024 MB (or more, depending on your system)
- Hard Disk: Create a new virtual disk (e.g., 10GB)
- Choose VDI (VirtualBox Disk Image) and Dynamically allocated.
- After creating the VM, proceed with installing Ubuntu using the ISO file.
- Repeat the process to create a second VM (e.g., Ubuntu-VM2).
Configure VirtualBox Network Settings
For this exercise, we’ll use two virtual network adapters for each VM to simulate two networks. VirtualBox allows you to create multiple virtual networks using different network modes like NAT, Bridged, Host-Only, and Internal.
Here, we’ll use Internal Network for communication between the VMs and NAT for internet access.
VM1 (Ubuntu-VM1) Setup:
- Open Settings for Ubuntu-VM1 in VirtualBox.
- Navigate to Network.
- Enable Adapter 1 and set the Attached to option to Internal Network.
- Name: intnet (This is a custom network name that both VMs will use for communication)
- Enable Adapter 2 and set the Attached to option to NAT for internet access.