Skip to content

VirtualBox

VirtualBox is free and open-source
While less performant than VMware it's the most accessible hypervisor for beginners , completely free , and runs on Windows , Linux , macOS , and Solaris

Installation

# Ubuntu/Debian
sudo apt install virtualbox virtualbox-ext-pack

# Download latest from virtualbox.org
# The extension pack adds USB 2.0/3.0, RDP, PXE boot, and disk encryption

# Guest Additions ISO included with VirtualBox
# Install within guest OS for better performance

VirtualBox Key Features

  • Snapshots (linear only, no branching like VMware)
  • Guest Additions (better integration, clipboard sharing, drag-and-drop)
  • VRDP (Remote Desktop Protocol server)
  • USB passthrough
  • Shared folders between host and guest
  • NAT, Bridged, Host-only, Internal networking
  • VM groups for organizing lab VMs

Network Configuration

# NAT (default) - VMs share host IP
# Good for: Internet access from VMs
# Bad for: VMs communicating with each other

# Bridged - VM gets own IP on host network
# Good for: Services accessible from LAN
# Bad for: Portability (IP changes with network)

# Host-only - Private network host<->VM
# Good for: Safe lab with host access
# Bad for: No internet in VM

# Internal - VMs talk to each other only
# Good for: Isolated malware lab
# Bad for: No internet , no host access

# NAT Network - VMs share network, can talk to each other
# Good for: Multi-VM labs with internet

Lab Setup Example

For a penetration testing lab:

  1. Create NAT Network: File -> Preferences -> Network -> Add NAT Network (10.0.2.0/24)
  2. Create Host-only Network: File -> Tools -> Network Manager -> Create (192.168.56.0/24)
  3. Kali VM: NAT Network (internet) + Host-only (management)
  4. Target VMs: NAT Network (internet for updates) + Host-only (Kali access)
  5. Malware Analysis VM: Internal network only (isolated)

CLI Tools

# List VMs
VBoxManage list vms
VBoxManage list runningvms

# Start VM headless
VBoxManage startvm "Kali" --type headless

# Stop VM
VBoxManage controlvm "Kali" acpipowerbutton
VBoxManage controlvm "Kali" poweroff  # Hard shutdown

# Take snapshot
VBoxManage snapshot "Kali" take "Post-Install"

# Restore snapshot
VBoxManage snapshot "Kali" restore "Post-Install"

# VM info
VBoxManage showvminfo "Kali"

# Modify VM
VBoxManage modifyvm "Kali" --memory 4096
VBoxManage modifyvm "Kali" --cpus 4

Limitations vs VMware

  • No 3D acceleration for OpenGL 3.0+ / DirectX 11
  • No nested virtualization (can't run Hyper-V inside)
  • Snapshot branching requires manual copying
  • Performance overhead higher than VMware
  • No USB 3.0 without extension pack