EMZETT.
Login

Setting up virtual machines with VirtualBox and Hyper-V

In short: A virtual machine is a completely simulated computer in a window: ideal for trying out Linux, for network exercises and for safely testing software.

In more detail: With VirtualBox, VMware Workstation Player, Hyper-V (Windows Pro) or KVM/virt-manager (Linux) a second operating system can be run safely next to your own. Errors stay inside the VM.

In Depth

Preparing

  • Enable CPU virtualisation in BIOS/UEFI (Intel VT-x, AMD-V/SVM).
  • Enough RAM (host ≥ 8 GB, VM 2 to 4 GB) and space (20 to 50 GB).
  • Download the system’s ISO (compare checksum).
  • Note: Hyper-V and VirtualBox/VMware can fight over the virtualisation feature; newer versions often run in parallel via the Windows Hypervisor Platform, but slower.

Creating a VM (VirtualBox)

  1. New → name, ISO, type/version.
  2. RAM and CPU cores (half as many as the host).
  3. Virtual hard disk (VDI, dynamic).
  4. Start, install like on real hardware.
  5. Install Guest Additions (resolution, clipboard, shared folders).
  6. Create a snapshot before risky experiments and roll back if problems occur. Windows 11 needs TPM 2.0/Secure Boot (Hyper-V generation 2, VirtualBox 7 with TPM option).

Network modes

  • NAT: VM reaches the internet, is not reachable from outside (default).
  • NAT network: several VMs see each other.
  • Bridged: VM sits in the LAN like its own computer (own IP).
  • Host-only: only host ↔ VM.
  • Internal network: only VMs among themselves (firewall/attack exercises). To practise subnetting, routing, DHCP, firewalls a whole lab network can be built from VMs (pfSense/OPNsense as router).

Tips and limits

  • Shared folders and clipboard are convenient, but switch them off for malware analysis.
  • Snapshots are not backups; many snapshots slow things down.
  • Performance: SSD, enough RAM, guest additions, no permanent 3D games (GPU passthrough is complex).
  • Export/import as OVA; Vagrant automates VMs.
  • Linux hosts: KVM/QEMU is faster than VirtualBox.
  • Alternatives: WSL2 (Linux without own VM interface), Docker (applications, not whole systems), live USB.
  • Licence: Windows VMs need a licence; VirtualBox is free (Extension Pack has its own licence).

See also: Virtualisation, KVM and QEMU, Trying out Linux, Docker