Free tech learning for everyone, from basics to pro

Cyber Security LabsLabsBeginner

Lab: building a safe, isolated virtual security lab

In short: Security practice needs a place where mistakes and deliberately vulnerable machines cannot hurt anyone. In this lab you build an isolated network of virtual machines, take clean snapshots, and prove the lab cannot reach your home or work network.

Aim and what you need

The aim is to create a safe practice environment that every other cyber security lab on this site can use. Isolation matters for two reasons: deliberately vulnerable machines must not be reachable by others, and your scans and tests must never touch systems you do not own. In most countries, including under the UK Computer Misuse Act 1990, accessing or testing someone else's system without permission is a crime.

  • A PC with at least 16 GB of RAM, a CPU with virtualisation turned on in the firmware, and 150 GB of free disk space.
  • A hypervisor. This lab uses Oracle VirtualBox (free); VMware Workstation, Hyper-V or Proxmox VE work in the same way.
  • Installers: Kali Linux (or another Linux with security tools), Ubuntu Server LTS, a Windows evaluation image from Microsoft, and optionally a deliberately vulnerable VM from a trusted training source.

Design

Isolated security labInternal networklabnet, 10.10.10.0/24Kali Linuxtools VMUbuntu Servertarget and logsWindowsevaluation VMVulnerable VMnever bridgedFirewall VMoptional gatewayHost PCno route in
Figure 1. All lab VMs share one internal network with no path to your home or work LAN; an optional firewall VM controls any internet access.
Hypervisor network modesSafe for lab targetsInternal networkHost-only adapterNAT network via firewall VMAvoid for vulnerable VMsBridged adapterNAT straight to internetShared folders left on
Figure 2. Internal and host-only modes keep lab traffic contained; bridged mode puts a VM directly on your real network.

Steps

  1. Install VirtualBox and create the VMs from their installers. While installing, give each VM temporary NAT access so it can download updates.
  2. Fully update each VM, then shut it down.
  3. Move every VM's network adapter to the internal network labnet. Internal networks have no DHCP by default, so either set static addresses or add a DHCP server for the network.
  4. Turn off shared folders, shared clipboard and drag-and-drop for vulnerable VMs.
  5. Take a "clean baseline" snapshot of every VM.
VBoxManage list vms
VBoxManage modifyvm "kali" --nic1 intnet --intnet1 "labnet"
VBoxManage modifyvm "ubuntu-srv" --nic1 intnet --intnet1 "labnet"
VBoxManage modifyvm "win-eval" --nic1 intnet --intnet1 "labnet"
VBoxManage dhcpserver add --network=labnet --server-ip=10.10.10.1 --netmask=255.255.255.0 --lower-ip=10.10.10.100 --upper-ip=10.10.10.199 --enable
VBoxManage modifyvm "ubuntu-srv" --clipboard-mode disabled --drag-and-drop disabled
VBoxManage snapshot "ubuntu-srv" take "clean-baseline" --description "patched, before any testing"

On Ubuntu Server, a static address can be set with a Netplan file such as /etc/netplan/50-lab.yaml, then applied:

network:
  version: 2
  ethernets:
    enp0s3:
      addresses: [10.10.10.20/24]
sudo netplan apply

Verify

Check each VM's adapter setting from the host, then test from inside the lab. Success means lab VMs can ping each other, but cannot reach your home router, your host PC's real address, or any internet name.

VBoxManage showvminfo "kali" --machinereadable | grep -i -E "nic1|intnet1"
ip -br address
ping -c 3 10.10.10.20
ping -c 3 192.168.1.1
ping -c 3 example.com

Replace 192.168.1.1 with your real home router address. Both of the last two pings must fail.

Troubleshooting and clean-up

  • VMs cannot see each other: the internal network name is case-sensitive; labnet and LabNet are different networks.
  • No addresses: the DHCP server is not enabled for the internal network, or the VM is still set to NAT.
  • VM is slow: give it fewer VMs running at once, not more RAM than the host can spare.
  • Need updates later: switch one VM back to NAT briefly, update, then return it to labnet. Never do this with a deliberately vulnerable VM.

After each exercise, restore the clean snapshot so the next lab starts from a known state. When you finish with the lab altogether, delete the VMs and their disks from VirtualBox. Document your lab (VM names, addresses, snapshots) as you would a real network: it makes a good portfolio piece too.

VBoxManage snapshot "ubuntu-srv" restore "clean-baseline"
VBoxManage unregistervm "old-vm" --delete

Practice

Why should a deliberately vulnerable VM never use a bridged adapter?
Bridged mode places it on your real network, where other devices (or attackers) could reach and compromise it.
What is the benefit of a "clean baseline" snapshot?
You can undo any change, infection or misconfiguration in seconds and repeat exercises from a known state.
Which ping results prove the lab is isolated?
Pings between lab VMs succeed, while pings to your real router and to internet names fail.

Key takeaways

  • Only ever test systems you own or have written permission to test.
  • Use an internal or host-only network so lab traffic cannot reach your real LAN.
  • Patch VMs before isolating them and disable shared folders and clipboard on targets.
  • Snapshot a clean baseline and restore it after each exercise.
  • Prove isolation with ping tests to your real router and the internet.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.