Installing Debian and CentOS Virtual Machines in VirtualBox
I installed Debian 12 and CentOS Stream 9 VMs in VirtualBox with sensible partitioning, bridged networking, and guest additions. A clean base image cloned in minutes became the reproducible starting point for every later lab.
Objective & Context
A disposable VM is the safest place to learn. This lab builds both a Debian- and an RHEL-family base so commands can be tested across package managers, the substrate for the server-admin and KVM labs.
Environment & Prerequisites
- VirtualBox 7.x with VT-x/AMD-V enabled.
- Debian 12 and CentOS Stream 9 ISOs.
- At least 4 GB RAM and 20 GB disk to spare.
flowchart LR
ISO[Download ISO] --> VM[Create VM + disk]
VM --> Inst[Guided install]
Inst --> GA[Guest Additions]
GA --> Clone[Snapshot/clone base]
Step-by-Step Execution
1. Create the VM disk from CLI
VBoxManage createvm --name debian12 --register && VBoxManage createmedium disk --filename debian12.vdi --size 204802. Verify the install booted
cat /etc/os-release | head -23. Snapshot the clean base
VBoxManage snapshot debian12 take clean-basePRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
Snapshot taken: clean-base
Validation & Testing
Boot each VM, confirm networking reaches the internet, and clone from the snapshot to verify reproducibility. Pass criteria: both distros install cleanly, have working bridged networking, and a snapshot restores a pristine base.
Advanced: Troubleshooting
- No 64-bit option: enable VT-x/AMD-V in the host BIOS.
- No network: switch the adapter to bridged or confirm NAT DNS.
- Slow VM: install Guest Additions and allocate more vCPU/RAM.
Key Results
- Built reproducible Debian and CentOS base images.
- Captured clean snapshots that clone in minutes.
- Verified bridged networking on both distros.
- Established a safe, disposable lab environment.