LFCS 4 🐧 Building a Lab with VMs
The LFCS is a performance-based exam. You cannot pass it by reading. The tasks require you to sit at a terminal and perform actions on a live system: create users, configure services, manage storage, troubleshoot networks. A virtual machine lab is the mechanism by which the knowledge becomes skill. This chapter walks through building that lab from scratch: choosing a hypervisor, installing the operating system, adding the disks that storage tasks require, and configuring the environment so that practice is efficient and repeatable.
Key point: A single virtual machine with 2 CPUs, 4 GB of RAM, a 40 GB system disk, and two or three additional 5–10 GB disks is sufficient for most LFCS practice . The additional disks are not optional—storage tasks require unpartitioned devices. A snapshot taken immediately after installation provides a clean baseline that can be restored whenever the system is broken.
Why a VM lab is necessary
The reset problem. Practice involves mistakes. A bad /etc/fstab entry can prevent the system from booting. A misconfigured firewall can lock you out. A partition table mistake can destroy data. A virtual machine can be snapshotted and restored, so mistakes are cheap. On a physical system, they are not.
The storage problem. The Storage domain is 20% of the exam and covers LVM, RAID, filesystem creation, and mount persistence . These tasks require raw, unpartitioned disks. A virtual machine with only a system disk cannot practice them. Adding two or three additional virtual disks costs almost nothing in resources and enables the entire storage domain.
The persistence problem. Many tasks require changes that survive a reboot. A mount must be in /etc/fstab. A firewall rule must be permanent. A service must be enabled. Practicing persistence means rebooting the VM and verifying that the change survived. A snapshot taken before the change allows a clean restart if the change breaks the system .
The distribution problem. The exam is distribution-independent, but the commands differ between Ubuntu and CentOS. A practice lab lets you use the distribution you are most comfortable with, or both. The tasks generalize, but the syntax does not always.
The cost problem. A cloud instance works, but it costs money and requires an internet connection. A local virtual machine is free after the initial setup, runs offline, and can be snapshotted instantly.
a. Choosing a hypervisor and installing the OS
VirtualBox and VMware are the common choices. VirtualBox is free and runs on Windows, macOS, and Linux. VMware Workstation Player is free for personal use. Both support snapshots, shared folders, and the virtual networking that the lab requires .
The recommended VM configuration is consistent across sources: 2 CPUs, 4 GB of RAM, and a 40 GB system disk . A laptop with 8 GB of RAM can run this VM comfortably. If the host has 16 GB or more, the VM can be given more resources, but 4 GB is sufficient for the tasks.
Ubuntu Server 22.04 LTS or 24.04 LTS is a common choice because the exam supports Ubuntu and the documentation is extensive . CentOS Stream or Rocky Linux is the alternative for candidates who prefer the Red Hat family. The installation is straightforward: download the ISO, create a new VM in the hypervisor, attach the ISO, and follow the installer.
During installation, a few choices matter. The system should be installed on the primary 40 GB disk. The additional disks should not be partitioned or formatted during installation—they are for practice, and the tasks will create the partitions, physical volumes, and filesystems. A user account with sudo privileges should be created. The OpenSSH server should be installed so that the VM can be accessed from the host terminal, which is more convenient than the hypervisor’s console .
After installation, the first action is to take a snapshot. This snapshot is the clean baseline. Every practice session begins with a restore to this snapshot and ends with another restore. The system stays clean, and mistakes have no lasting consequence .
b. Adding virtual disks for storage practice
The additional virtual disks are added through the hypervisor’s storage settings. They should be small—5 to 10 GB each—and they should be created as dynamically allocated VMDK or VDI files so they consume disk space only as data is written .
Two disks are sufficient for RAID 1 practice. Three disks are needed for RAID 5 and for LVM configurations with multiple physical volumes . The LFCS storage domain includes LVM, RAID with mdadm, and filesystem creation, so three disks provide the most flexibility.
After the disks are added, the VM is booted and the disks are verified with lsblk. The new disks appear as sdb, sdc, and sdd. They should be unpartitioned and unmounted. If the installer created partitions on them, those partitions should be removed before practice begins .
A critical step before using the disks for LVM or RAID practice is to wipe any existing signatures. A disk that was previously used for a filesystem, a physical volume, or a RAID array carries metadata that can confuse pvcreate or mdadm. The wipefs -a /dev/sdb command removes all signatures from a device . This is the first command to run on a new practice disk.
c. Configuring the lab for efficient practice
SSH access to the VM eliminates the need to use the hypervisor’s console. The VM’s network should be configured so that the host can reach it. VirtualBox’s NAT network with port forwarding, or a bridged adapter, both work. Once SSH is configured, the host terminal can be used for all practice, with multiple windows open for different tasks .
Shared folders between the host and the VM are useful for transferring notes and scripts, but they are not necessary. A simpler approach is to keep a notes file on the VM itself, in the root user’s home directory, with the commands and configuration file locations that are practiced most often. The man pages are available on the VM, and the exam allows their use. Practicing with man pages, rather than web searches, builds the habit that the exam requires .
A second virtual machine is useful for networking tasks that involve two hosts. A reverse proxy, a load balancer, or a static routing configuration is easier to practice with two VMs connected through a virtual network. The GNS3 lab for LFCS provides a pre-built environment with questions and solutions, but it requires 8 GB of RAM and a host with GNS3 and QEMU installed . A simpler alternative is two VirtualBox VMs connected through an internal network.
The practice routine should include a reboot after each persistence-related change. After adding a mount to /etc/fstab, the command mount -a verifies the entry before rebooting. After enabling a service, systemctl is-enabled service confirms that it will start at boot. After configuring a firewall rule with --permanent, the --reload command applies it, and the firewall’s list command verifies it. The grader checks the state after reboot, and so should the practice .
Complete Example Session
# ============================================
# PART 1: HYPERVISOR SETUP
# ============================================
# VirtualBox or VMware installed on host
# Download Ubuntu Server 22.04 or 24.04 LTS ISO
# ============================================
# PART 2: VM CONFIGURATION
# ============================================
# Create VM:
# Type: Linux
# Version: Ubuntu (64-bit)
# RAM: 4096 MB
# CPU: 2
# Disk: 40 GB VDI (dynamically allocated)
# Attach ISO
# Install Ubuntu Server
# - Install OpenSSH server
# - Create user with sudo
# ============================================
# PART 3: ADD EXTRA DISKS
# ============================================
# In VM settings, add storage:
# Disk 2: 10 GB VDI
# Disk 3: 10 GB VDI
# Disk 4: 10 GB VDI
# Boot VM, verify:
lsblk
# sdb, sdc, sdd should be present and unpartitioned
# ============================================
# PART 4: WIPE DISK SIGNATURES
# ============================================
sudo wipefs -a /dev/sdb
sudo wipefs -a /dev/sdc
sudo wipefs -a /dev/sdd
# ============================================
# PART 5: SNAPSHOT CLEAN BASELINE
# ============================================
# In hypervisor: take snapshot "Clean Install"
# This is the state to return to after practice
# ============================================
# PART 6: SSH ACCESS
# ============================================
# From host:
ssh user@vm-ip
# Use host terminal for practice
# ============================================
# PART 7: STORAGE PRACTICE EXAMPLE
# ============================================
sudo pvcreate /dev/sdb
sudo vgcreate myvg /dev/sdb
sudo lvcreate -L 5G -n mylv myvg
sudo mkfs.ext4 /dev/myvg/mylv
sudo mkdir /mnt/data
sudo mount /dev/myvg/mylv /mnt/data
df -h /mnt/data
# ============================================
# PART 8: PERSISTENCE TEST
# ============================================
echo '/dev/myvg/mylv /mnt/data ext4 defaults 0 0' | sudo tee -a /etc/fstab
sudo mount -a
sudo reboot
# After reboot:
df -h /mnt/data
# ============================================
# PART 9: RAID PRACTICE EXAMPLE
# ============================================
sudo mdadm --create --verbose --level=1 --metadata=1.2 \
--raid-devices=2 /dev/md/MyRAID1 /dev/sdb /dev/sdc
sudo mkfs.ext4 /dev/md/MyRAID1
sudo mount /dev/md/MyRAID1 /mnt/data
cat /proc/mdstat
# ============================================
# PART 10: RESTORE SNAPSHOT
# ============================================
# In hypervisor: restore "Clean Install" snapshot
# System is back to baseline
# Next practice session starts clean
The ten parts covered hypervisor setup, VM configuration, adding extra disks, wiping disk signatures, taking a snapshot, SSH access, storage practice, persistence testing, RAID practice, and restoring the snapshot.
Quick Reference
VM Configuration
| Component | Recommendation |
|---|---|
| Hypervisor | VirtualBox (free) or VMware |
| OS | Ubuntu Server 22.04/24.04 LTS |
| CPU | 2 |
| RAM | 4 GB |
| System disk | 40 GB dynamically allocated |
| Extra disks | 2–3 × 5–10 GB |
| Snapshot | After installation |
| SSH | Enabled |
Disk Preparation
| Command | Purpose |
|---|---|
lsblk | Verify disks are detected |
wipefs -a /dev/sdX | Remove signatures |
fdisk /dev/sdX | Partition (if needed) |
parted /dev/sdX | GPT partitioning |
Practice Workflow
| Step | Action |
|---|---|
| 1 | Restore clean snapshot |
| 2 | SSH into VM |
| 3 | Perform task |
| 4 | Verify state |
| 5 | Reboot and verify persistence |
| 6 | Restore snapshot |
Key Configuration Files
| File | Purpose |
|---|---|
/etc/fstab | Persistent mounts |
/etc/sysctl.d/ | Kernel parameters |
/etc/systemd/system/ | Custom services |
/etc/ssh/sshd_config | SSH configuration |
/etc/exports | NFS shares |
Best Practices
✅ Do This:
# Take a snapshot after installation
Restore it before every session # ✅
# Add 2-3 extra virtual disks
Storage tasks require unpartitioned devices # ✅
# Wipe disk signatures before use
wipefs -a /dev/sdb /dev/sdc /dev/sdd # ✅
# Enable SSH for host terminal access
More convenient than hypervisor console # ✅
# Test persistence after every change
Reboot and verify # ✅
# Practice with man pages
The exam allows them, practice using them # ✅
# Keep a notes file on the VM
Commands, file locations, pitfalls # ✅
❌ Don’t Do This:
# Don't practice without snapshots
A broken system is not a practice environment # ❌
# Don't skip the extra disks
Storage tasks cannot be practiced without them # ❌
# Don't use previously-used disks without wiping
Signatures confuse pvcreate and mdadm # ❌
# Don't forget to test persistence
The grader checks state after reboot # ❌
# Don't rely on web searches during practice
The exam does not have internet # ⚠️
# Don't use a production system
Use a VM # ❌
# Don't skip verification
Check the state after every task # ❌
Common Pitfalls
| Pitfall | Why It Happens | Fix |
|---|---|---|
| No extra disks | Only system disk | Add 2–3 virtual disks |
| Disk signatures present | Previously used disks | wipefs -a before use |
| System broken | Bad fstab or firewall | Restore snapshot |
| Persistence not tested | Forgot to reboot | Reboot and verify |
| SSH not configured | Used console only | Install openssh-server |
| No snapshot | Started practicing immediately | Take snapshot first |
| Resource exhaustion | Too many VMs | Use one VM |
Real-World Examples
1. VM Creation
VirtualBox → New VM
Name: LFCS-Practice
Type: Linux
Version: Ubuntu (64-bit)
RAM: 4096 MB
CPU: 2
Disk: 40 GB VDI
2. Add Disks
Settings → Storage → Add Hard Disk
Create new disk
VDI, dynamically allocated
10 GB
Repeat for sdc, sdd
3. Wipe Signatures
sudo wipefs -a /dev/sdb
sudo wipefs -a /dev/sdc
sudo wipefs -a /dev/sdd
4. LVM Practice
sudo pvcreate /dev/sdb
sudo vgcreate myvg /dev/sdb
sudo lvcreate -L 5G -n mylv myvg
sudo mkfs.ext4 /dev/myvg/mylv
5. RAID Practice
sudo mdadm --create --verbose --level=1 \
--raid-devices=2 /dev/md/MyRAID1 /dev/sdb /dev/sdc
cat /proc/mdstat
6. Persistence Test
echo '/dev/myvg/mylv /mnt/data ext4 defaults 0 0' >> /etc/fstab
mount -a
reboot
df -h /mnt/data
7. Firewall Practice
# Ubuntu
ufw allow 80/tcp
ufw status
# CentOS
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload
8. Service Practice
systemctl enable --now myapp
systemctl status myapp
systemctl is-enabled myapp
9. User Practice
useradd -m -s /bin/bash -u 1500 alice
id alice
10. Restore Snapshot
In hypervisor: Snapshots → "Clean Install" → Restore
System returns to baseline
Visual
VM Lab Architecture
┌─────────────────────────────────────────────────────────────┐
│ HOST MACHINE │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Hypervisor (VirtualBox / VMware) │ │
│ │ │ │
│ │ ┌───────────────────────────────────────────────┐ │ │
│ │ │ VM: LFCS-Practice │ │ │
│ │ │ 2 CPU, 4 GB RAM │ │ │
│ │ │ │ │ │
│ │ │ /dev/sda (40 GB) System disk │ │ │
│ │ │ /dev/sdb (10 GB) Storage practice │ │ │
│ │ │ /dev/sdc (10 GB) Storage practice │ │ │
│ │ │ /dev/sdd (10 GB) Storage practice │ │ │
│ │ │ │ │ │
│ │ │ SSH enabled for host terminal access │ │ │
│ │ └───────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Snapshot: "Clean Install" │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Practice Session Flow
┌─────────────────────────────────────────────────────────────┐
│ RESTORE SNAPSHOT (clean baseline) │
│ │ │
│ ▼ │
│ SSH INTO VM │
│ │ │
│ ▼ │
│ PERFORM TASK │
│ │ │
│ ▼ │
│ VERIFY STATE │
│ │ │
│ ▼ │
│ REBOOT & TEST PERSISTENCE │
│ │ │
│ ▼ │
│ RESTORE SNAPSHOT (ready for next) │
│ │
│ Mistakes are free. The snapshot is the reset button. │
│ │
└─────────────────────────────────────────────────────────────┘
Disk Layout for Practice
┌─────────────────────────────────────────────────────────────┐
│ DISK LAYOUT │
│ │
│ /dev/sda 40 GB System (OS installed) │
│ /dev/sdb 10 GB Raw (for LVM, RAID, filesystem practice)│
│ /dev/sdc 10 GB Raw (for RAID, LVM) │
│ /dev/sdd 10 GB Raw (for RAID 5, spare) │
│ │
│ sdb, sdc, sdd are unpartitioned. │
│ Practice creates partitions, PVs, VGs, LVs, filesystems. │
│ wipefs -a clears them between sessions. │
│ │
└─────────────────────────────────────────────────────────────┘
Snapshot Strategy
┌─────────────────────────────────────────────────────────────┐
│ SNAPSHOT LIFECYCLE │
│ │
│ 1. Install OS │
│ 2. Take snapshot "Clean Install" │
│ 3. Practice session │
│ 4. Break something? ──▶ Restore "Clean Install" │
│ 5. Practice again │
│ 6. Ready for exam? ──▶ Keep snapshot for review │
│ │
│ One snapshot is sufficient. │
│ Restore before every session. │
│ │
└─────────────────────────────────────────────────────────────┘
Summary
| Item | Value |
|---|---|
| Hypervisor | VirtualBox or VMware |
| OS | Ubuntu Server 22.04/24.04 LTS |
| CPU | 2 |
| RAM | 4 GB |
| System disk | 40 GB |
| Extra disks | 2–3 × 5–10 GB |
| Disk preparation | wipefs -a |
| Snapshot | After installation |
| SSH | Enabled |
| Practice workflow | Restore, practice, verify, reboot, restore |
Key takeaways:
- A single VM is sufficient for most LFCS practice. The recommended configuration is 2 CPUs, 4 GB of RAM, and a 40 GB system disk. A laptop with 8 GB of RAM can run this comfortably .
- Extra virtual disks are required for storage practice. The Storage domain is 20% of the exam and covers LVM, RAID, and filesystem creation. These tasks need unpartitioned disks. Add two or three disks of 5–10 GB each .
- Wipe disk signatures before use. A disk that was previously used carries metadata that can confuse
pvcreateandmdadm. Thewipefs -acommand removes all signatures . - Take a snapshot after installation. This is the clean baseline. Restore it before every practice session. Mistakes are free because the snapshot is the reset button .
- Enable SSH for host terminal access. Practicing from the host terminal is more convenient than the hypervisor console. Multiple windows can be open for different tasks .
- Test persistence after every change. A mount must be in
/etc/fstab. A firewall rule must be permanent. A service must be enabled. Reboot and verify that the change survived . - Practice with
manpages. The exam allows their use and does not have internet access. Building the habit of finding information inmanpages during practice prepares you for the exam environment .
Remember: The LFCS is a practical exam, and practical skill comes from practice. A virtual machine on your laptop, snapshotted and restored, is the mechanism that makes practice safe and repeatable. The extra disks enable the storage domain. The snapshot enables the mistakes. SSH enables the workflow. The practice routine is simple: restore, practice, verify, reboot, restore. The commands will become automatic, and the exam will feel like another day in the terminal.
Stop using slow, ad-bloated tool sites! 🤮
🔎 Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
✅ Finance (Mortgage, Interest, Inflation)
✅ Tech (Base64, JSON, Dev Suite, IP)
✅ Health (BMI, BMR, TDEE)
✅ Productivity (Timer, Workspace, QR)
⚡️ Fast & Private
🔒 No data leaves your device
💎 100% Free
🔗 Use it now: https://tools.kandz.me
🔖 Bookmark it—you’ll need it later!