Sub topic 9
Setting up a virtual machine lab
A virtual machine (VM) lab lets you break things, repair them, and repeat the process without risking your own computer. This chapter covers how to size the lab, build a Windows 11 guest and a Linux guest, and keep both recoverable. It assumes you can install software and follow vendor setup steps. It also assumes you know basic hardware terms such as RAM, storage, and CPU cores.
Why a VM lab fits A+ study
Many A+ objectives involve operating systems, networking, command-line tools, and security settings. You can practice all of these in VMs. Hardware identification still needs physical parts, and the hardware practice chapter covers that.
A hypervisor is the software that creates and runs VMs. The computer that runs it is the host. Each VM is a guest. A guest sees virtual hardware: a virtual CPU, virtual RAM, a virtual disk file, and a virtual network adapter.
There are two kinds of hypervisor:
| Type | Runs on | Examples | Typical use |
|---|---|---|---|
| Type 1 (bare metal) | Directly on hardware | Hyper-V role, VMware ESXi | Servers, dedicated lab machines |
| Type 2 (hosted) | Inside a host OS | VirtualBox, VMware Workstation Player, Hyper-V on Windows Pro | Desktop study labs |
The A+ objectives expect you to know virtualization concepts such as hypervisors and resource requirements. Running a hosted hypervisor teaches those concepts directly.
Check the host first
Before you download anything, confirm your host can run a lab.
- CPU virtualization support. Intel calls it VT-x and AMD calls it AMD-V. Most firmware (UEFI/BIOS) ships with it disabled on some models. If your hypervisor reports that hardware acceleration is unavailable, enable the setting in firmware.
- RAM. Leave at least 4 GB for the host. A Windows 11 guest wants 4 GB. A light Linux guest runs in 2 GB. Running both at once needs about 10 GB of total RAM, so 16 GB is comfortable.
- Disk space. Budget 60 GB for Windows 11 and 20 GB for Linux. Virtual disks are usually thin provisioned, which means the file grows as the guest uses space. Plan for the maximum anyway.
- SSD. A solid-state drive makes guests much faster than a hard disk drive.
Choose the guests
Build two guests so you can compare the platforms.
- A Windows 11 guest. This covers Settings, Control Panel, Device Manager, Task Manager, Disk Management, user accounts, and Windows command-line tools.
- A Linux guest. Ubuntu Desktop or Debian are common choices. This covers file permissions, package managers, the
iptools, and basic shell use.
Later chapters use these two guests for networking, operating system administration, and security practice.
Create the Windows guest from the command line
You can use the VirtualBox graphical wizard or its VBoxManage command-line tool. The command line is repeatable, so it is useful when you rebuild a lab.
VBoxManage createvm --name "APlus-Win11" --ostype Windows11_64 --register
VBoxManage modifyvm "APlus-Win11" --memory 4096 --cpus 2The first command creates and registers the VM. The second assigns 4 GB of RAM and two CPUs. The VM is not bootable yet. You still need to:
- Create a virtual disk of about 60 GB and attach it to a storage controller.
- Attach the installation ISO (a disk image file) as a virtual optical drive.
- Set the firmware to EFI and enable a TPM if your version supports it.
- Start the VM and complete the installer.
Networking modes
The virtual network adapter's mode decides what the guest can reach. Pick the mode to match the exercise.
| Mode | Guest reaches the internet | Guest reaches other guests | Host reaches guest | Best for |
|---|---|---|---|---|
| NAT | Yes | No | No (without port forwarding) | Updates and downloads |
| Bridged | Yes | Yes | Yes | Guest gets an address on your real network |
| Internal network | No | Yes, on the same network name | No | Isolated multi-VM practice |
| Host-only | No | Yes | Yes | Host-to-guest testing |
NAT (network address translation) is the default and is safe. Bridged mode puts the guest on your home network, so it appears as another device on your router. Use internal networking when you want guests to talk to each other and nothing else.
Verify the lab with commands
After installation, confirm that each guest has working networking. On the Windows guest, work from the inside out:
ipconfig /all
ping 127.0.0.1
ping <default-gateway-address>
nslookup example.com
tracert example.comThe first command shows the address, gateway, and DNS server. The 127.0.0.1 ping tests the local TCP/IP stack. Pinging the gateway tests the local link. nslookup tests name resolution, and tracert shows the path to a remote host. A failure at one step tells you where to look.
On the Linux guest:
ip addr show
ip route show
ping -c 4 <default-gateway-address>
resolvectl statusip addr show lists interface addresses. ip route show lists the default route. resolvectl status shows DNS settings when the guest uses systemd-resolved.
Snapshots and backups
A snapshot saves a guest's disk and settings at one moment so you can return to it. Take one:
- Right after the operating system installs and updates.
- Before every risky exercise, such as editing the registry, changing partitions, or removing a driver.
Name snapshots by their state, for example clean-install-updated. Then you can break a guest on purpose, practice repairing it, and roll back.
Snapshots are not backups. They live next to the original disk file, and a long chain of snapshots slows the guest and uses disk space. Delete old ones. Export the finished baseline guest as an appliance file if you want a real copy.
Practice repairs
A clean lab is useful for rehearsing repairs. In an elevated PowerShell prompt on the Windows guest:
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
chkdsk C: /scansfc checks protected system files. DISM repairs the component store that sfc draws from. chkdsk C: /scan checks the file system online. Take a snapshot before you damage anything on purpose.
Common errors
- "VT-x is not available." Virtualization is disabled in firmware. On Windows, other features such as Hyper-V or Windows Sandbox can also hold the hardware. Turn them off or use a hypervisor that cooperates with them.
- The guest is slow. The host may be out of RAM and swapping. Lower guest memory or close other programs. Giving a guest more CPUs than the host can spare also slows both.
- No network in the guest. Check that the adapter is enabled and the mode is correct. An internal network has no DHCP server unless you provide one.
- The installer cannot find a disk. The virtual disk is not attached to a storage controller.
- Guest screen stays small. Install the guest additions or integration tools for your hypervisor.
Keep the lab small
Do not build a large environment. Two guests plus snapshots cover most of what the exam tests. Add a third guest only when an exercise needs it, and shut guests down when you are not using them.
Exercise
You want a Windows guest and a Linux guest to ping each other but have no access to your home network or the internet. Which network mode should you choose for both, and what must you supply that the mode does not provide?
Show answer
Use an internal network, with both adapters set to the same network name. An internal network has no DHCP server, so you must assign static IP addresses to each guest (or run a DHCP service on one of them) before they can ping each other.
Exercise
You are about to practice deleting a driver in the Windows guest. What should you do first, and why is this not the same as a backup?
Show answer
Take a snapshot with a descriptive name, such as clean-install-updated, so you can roll back after the exercise. A snapshot depends on the original disk file and is stored beside it, so it does not protect you if that storage fails. An exported appliance or copied disk file is a real backup.