(Guide) A Primer On Provisioning Virtual Machines With VirtualBox
(Guide) A Primer On Provisioning Virtual Machines With VirtualBox
In the context of security, VirtualBox is perfect for setting up personal labs for cybersecurity
practice. You can install vulnerable VMs to practice hacking skills, network configurations,
or simulate small networks, all in a safe, isolated space. This is what we will be doing in this
project!
Here’s a bit more detail on the five main VirtualBox networking settings.
1. NAT (Network Address Translation): NAT is the default network mode, where
VirtualBox acts like a middleman for internet access. Your virtual machine (VM) can
go online, but it’s hidden from your main network and other VMs, keeping things
secure and simple. Great if you just need internet access without any extra setup.
2. NAT Network: NAT Network is similar to regular NAT but allows multiple VMs to see
each other while still keeping them hidden from the rest of your network. This is
useful if you want to set up a small, private network between VMs that can also
connect to the internet, like a mini-lab setup.
3. Bridged Adapter: Bridged Adapter connects your VM directly to your actual
network, as if it were just another device on your Wi-Fi or Ethernet. The VM gets its
own IP address on the network and can communicate freely with other devices. This
is ideal if you want full access to your network for testing or server setups.
4. Internal Network: Internal Network is like having a private network that’s entirely
cut off from the internet and your host machine. VMs on this network can talk to
each other, but that’s it. It’s perfect if you want to isolate a group of VMs for secure
testing without any outside interference.
5. Host-Only Adapter: Host-Only Adapter creates a direct link between your host
machine and your VMs without internet access. The VM can talk to the host and
other VMs on the same setting, but it’s fully isolated from the wider network. This is
useful for testing things locally or setting up a host-to-VM-only environment.
For this project, we will be using the NAT Network setting, this will allow us to have the VMs
communicate with one another, while also having access to the Internet.
Download VirtualBox
Step 1
Navigate to VirtualBox.org [link]. Select the Host operating system you are currently working
with.
Step 2
Select all system defaults designated in the installation wizard, unless you would like to
customize.
Host Key
In VirtualBox, the Host Key is a special key or combination of keys that allows you to
interact with the VirtualBox application itself rather than the guest operating system
running inside the virtual machine (VM).
o On most systems, the default Host Key is the Right Ctrl key. However, this
can vary based on your system configuration or preferences.
“Input” View the “Host Key Combination”. You can change the Host Key by selecting the
box and then hit the key on the keyboard to specify which key to use.
Step 2
At the bottom, name the NatNetwork “project-x-network” and choose an IPv4 prefix, refer
to the Project Overview guide for more detail on IPv4 prefixes. Select “Apply” to save
changes.
� It will be assumed that each time a new Virtual Machine has been
provisioned, the “project-x-network” NAT Network will be selected for all
VMs.
Download ISOs
From ISO Provider
� Downloading from the ISO provider will not lock in the versions used throughout this
project. This will likely not result in any major disruption to the project, but UI changes may
occur.
Step 2
Enter a name for the virtual machine. Choose default Folder location. Select “Type: Microsoft
Windows”. Version: “Windows 2022 (64-bit)”
Add hardware specifications. A minimum of 4 GBs of RAM (4096 MB) and 2 CPU for every
virtual machine, unless explicitly expressed.
Step 3
Select newly created virtual machine. Go to “Settings”.
Select the “Storage” tab. Click the “Empty” optical drive disk. Then select “Choose a disk file…”
Navigate to where your ISO has been downloaded. (By default, should be Downloads folder).
Click “Open” to open the ISO.
Step 4
Navigate to “Network” tab. Select “NAT Network” in the Attached to option. Choose “project-x-
network” in the Name option. Select “OK”.
Step 5
Select the Virtual Machine, then Select “Start”.
When the machine provisions, you will see a message related to hitting a key. Hit any letter key
on your keyboard to provision into the installation wizard of the operating system.
Take A Snapshot
Virtual Machine Snapshot: A saved state of a virtual machine (VM) at a specific point in time. It
allows you to preserve the exact state of the VM, including its disk, memory, and hardware
settings, so that you can revert to this state later if needed.
Step 1
Go to VirtualBox. Select Virtual Machine, then select “Take”.
Step 2
Title the snapshot with something descriptive so you can recall what configurations were
made up until this point.
Restore Snapshot
Go to VirtualBox. Select Virtual Machine. Select which snapshot you want to restore to.
Then “Restore”.
Step 2
Navigate to the “File Explorer” application in Windows. Go to “This PC”. Click into the
“VirtualBox Guest Additions” program.
You should see a few executables (programs). Select the generic “VBoxWindowsAdditions”
program.
Step 2
A new CD disk image will appear on the tool bar. Select this.
Step 3
A new file menu will appear. Right-click on the whitespace Select “Open in Terminal”.
Step 4
A new terminal will appear, type the following, type the user’s password:
sudo ./VBoxLinuxAdditions.run
Step 5
Allow the system to reboot after your user prompt has returned. You can type reboot to
restart the machine.
reboot
Success!