Building a Home Lab
In this post, we’ll use VirtualBox—a free and open-source hypervisor—to build a virtual lab, specifically running Parrot OS, a security-focused Linux distribution.
🧪 Building a Home Lab with VirtualBox
For a long time, building a home lab meant investing in physical hardware—servers, routers, switches, and more. But today, most modern computers are powerful enough to run several virtual machines (VMs) simultaneously using a hypervisor.
A hypervisor is software that allows you to create and manage virtual machines. It lets your host computer (e.g., a desktop or laptop) allocate memory, CPU, and other resources to virtual environments that run independently of your host operating system.
This isolation is especially useful for security research, development testing, or connecting to external networks (e.g., client environments) safely. While VM breakout vulnerabilities exist, this model still provides a solid layer of protection.
🧰 Installing VirtualBox
Prerequisites
In order for VirtualBox to run other operating system in virtual machine alongside a linux host, it requires drivers modules: - vboxdrv
– core driver module - vboxnetflt
and vboxnetadp
– for virtual networking
Before these modules can be built, ensure that gcc
, make
, and the correct kernel headers are installed.
Check if gcc
and make
are available:
which gcc make
Expected output:
/usr/bin/gcc
/usr/bin/make
Install kernel headers (if not already present):
sudo apt install linux-headers-$(uname -r)
UEFI Secure Boot and unsigned kernel modules
If your system uses UEFI Secure Boot, unsigned kernel modules won’t be loaded. You’ll need to manually sign the VirtualBox kernel modules. This is required because Secure Boot only allows signed kernel modules to load, and VirtualBox modules are unsigned by default.
- 🔍 Check Secure Boot Status.
sudo mokutil --sb-state
If Secure Boot is enabled, you’ll need to generate and enroll a Machine Owner Key (MOK):
- 🧾 Create and import a signing key.
sudo mkdir -p /var/lib/shim-signed/mok
sudo openssl req -new -x509 -newkey rsa:2048 -nodes \
-outform DER \
-keyout /var/lib/shim-signed/mok/MOK.priv \
-out /var/lib/shim-signed/mok/MOK.der \
-subj "/CN=VirtualBox MOK/" \
-addext "extendedKeyUsage=codeSigning"
sudo mokutil --import /var/lib/shim-signed/mok/MOK.der
Reboot your system. During boot, the MOK manager will prompt you to enroll the key. Once the modules are signed and loaded, you’re ready to install VirtualBox
💡 Run lsmod | grep vbox
to verify that VirtualBox modules are loaded.
Installing
To install VirtualBox and its extension pack on a Debian-based Linux system:
sudo apt install virtualbox virtualbox-ext-pack
💡 The extension pack provides support for USB devices, RDP, and more.
🐉 Penetration Testing VM
Linux: Kali
Follow the official Parrot documentation for importing the image into VirtualBox: 🔗 Install Parrot OS on VirtualBox + Encrypt Disk + virtualbox encryption https://academy.hackthebox.com/module/87/section/882
- Take snapshot use dotfile to install basic tools such as bitwarden + ghossty + oh my zsh + neovim