A virtual machine lab on your own computer
Turn one ordinary computer into several practice machines using free virtualisation, with safe networks and snapshots, so you can build servers, break them and start again.
What you need
A virtual machine (VM) is a pretend computer that runs inside your real one. Because it is only files on your disk, you can make a mess of it and put it back in a minute. Almost every practical course on this site can be repeated in VMs.
Your host computer needs enough memory to run the host and the VMs together. Plan roughly: host 4 GB, each Linux server VM 1 to 2 GB, each Windows Server VM 4 GB. Hardware virtualisation (Intel VT-x, AMD-V) must be enabled in the firmware (BIOS/UEFI) settings; it is often off by default on older machines.
Choose a tool. VirtualBox (virtualbox.org) is free and runs on Windows, Linux and Intel Macs. On Windows Pro or Enterprise you can use Hyper-V (turn it on in “Windows features”). On Apple Silicon Macs use UTM (mac.getutm.app) or Multipass. You do not need to pay for any of them.
Set it up
- Install your tool and restart if it asks.
- Download an installer image from the vendor’s own site: Ubuntu Server LTS (ubuntu.com) for Linux; Windows Server Evaluation (the Microsoft Evaluation Center) for Windows labs, which is free for a limited trial period.
- Create a VM: give it 1 to 2 CPUs, the memory above, and a 20 to 40 GB disk (dynamically allocated, so it only uses what it needs). Attach the ISO and install.
- Choose the network on purpose. This matters more than anything else in a lab:
- NAT: the VM can reach the internet, but nothing can reach it. Safe default for a single machine.
- Host-only: the VM and your computer can talk to each other and to nothing else. Safest for risky or security practice.
- Internal network: only the VMs you place on the same named network can talk. Use it to build a private lab of several machines.
- Bridged: the VM appears on your home network like a real device. Use it only when you need other real devices to reach it, and never for vulnerable systems.
- For a multi-machine lab, give each VM two adapters: one NAT (for updates) and one internal network (for the lab), then set fixed addresses on the internal one, such as 10.10.10.0/24.
- Install the guest tools or additions your tool offers (better screen and clipboard).
Check that it works
- The VM boots to a login prompt and you can sign in.
pingbetween two VMs on the internal network succeeds, and a VM on host-only cannot reach the internet.- You can take a snapshot, change something, restore the snapshot, and the change is gone.
If a VM will not start and mentions virtualisation, enable VT-x/AMD-V in the firmware and, on Windows, check that another hypervisor feature is not blocking it.
Practise safely
- Snapshot before every risky step and name the snapshot after what it holds (“clean install”, “before editing the firewall”).
- Keep a clean template VM you never use for experiments; clone it for each new lab.
- Never bridge a deliberately vulnerable system to your real network.
- Do not store real passwords, customer data or work files in lab VMs.
- Free disk space before you start: VMs and snapshots grow.
Go further
- Build a small company network: one router VM, one server VM and two client VMs on an internal network, with services running between them.
- Practise recovery: corrupt a configuration file or fill the disk on purpose, then fix it using only the console.
- Time yourself rebuilding the lab from your clone, and write the steps down until you can do it without looking.
- Free challenge sites that give you a safe place to practise are available online (OverTheWire, picoCTF and others); read their rules and current free offers first.
Courses that use this lab
Other lab guides
- A Linux practice machine
- A network lab with free simulators and virtual routers
- A packet-capture lab with Wireshark and tcpdump
- A network-services lab: DHCP, DNS, proxy, load balancer, time and failover
- A Windows Server and Active Directory lab
- A developer workstation: editor, Git, Python and Node
- A container and Kubernetes lab
- A monitoring lab with Prometheus and Grafana
- A security operations (SOC) practice lab
- An isolated security lab for authorised practice
- A cloud lab that cannot surprise you with a bill
- An embedded and microcontroller lab: simulators first, hardware second
- An electronics lab: simulate first, then build on a breadboard
- A Raspberry Pi lab, with or without a Pi
- A home automation lab with Home Assistant and MQTT
- An audio, video, streaming and show-control lab
- A data lab: Python, pandas and Jupyter on your own computer
- A machine learning lab: scikit-learn, notebooks and honest experiments
- An LLM lab: a free local model, embeddings and a test harness
- A TypeScript lab: Node.js, the compiler and a test runner
- A web deployment lab: Git, a free host and environment settings
Software changes quickly. Menu names and version numbers may differ a little from what you see; the ideas and the check at the end of each section stay the same. Always download from the project's own website, and read the licence terms for your situation.