| |

LFCE 3 ๐Ÿง Building a Practice Lab โ€” Options and Setup

โฑ๏ธ Estimated read: 10 min | |

The previous chapters covered the LFCE exam structure and its retirement. This chapter covers the practical foundation for studying the advanced skills the LFCE tested: the practice lab. A performance-based exam cannot be prepared by reading. The candidate must type the commands, break the services, and recover the systems. The lab is the environment where this happens. The LFCE required multi-system scenarios: the DNS server, the DHCP server, the web server, and the centralized authentication server, all interacting. A single VM is insufficient. The lab must provide the multiple nodes, the isolated network, and the disposable state.

Key point: The practice lab is the mandatory prerequisite for the advanced study. The local virtual machines with the hypervisor (VirtualBox, VMware, or KVM/libvirt) provide the free, offline, and maximum-control environment. The cloud instances provide the multi-system networking without the local hardware. The Linux Foundation labs provide the exam-like interface at the higher cost. The lab must be built before the study begins, and the snapshot must be taken as the clean baseline for the easy reset.


Why the practice lab requires a specific mental model

The multi-system problem. The LFCE Service Configuration domain tested the integration of the nine services. The DNS server must resolve the names for the web server. The DHCP server must assign the addresses to the nodes. The PXE server must boot the client. The single VM cannot demonstrate the integration. The lab must have at least two or three VMs on the shared network.

The disposable problem. The advanced scenarios involve the destructive changes: the partition table, the firewall rules, the SELinux contexts, the DNS zone files. The mistake breaks the system. The snapshot is the recovery. The lab must be the snapshot-capable, and the candidate must take the clean baseline before the experiments.

The resource problem. The multiple VMs consume the RAM and the disk. The typical lab VM is the 2 CPU, the 4 GB RAM, and the 20โ€“40 GB disk. The two or three VMs require the host with the 16 GB RAM and the 100 GB free disk. The candidate must verify the host resources before the lab creation.

The network problem. The VMs must communicate with each other. The bridged network or the host-only network provides the connectivity. The NAT network provides the internet access. The combination is the common: the NAT for the internet, the host-only for the inter-VM. The alternative is the single bridged interface for the simple lab .

The trade-off. The local VMs are the free and the offline, but the hardware is the limit. The cloud instances are the scalable and the multi-system, but the cost is the hourly and the network is the external. The Linux Foundation labs are the exam-like, but the cost is the highest. The local VMs are the recommended for the LFCE study .


a. The local virtual machines with the hypervisor

The local VMs are the most flexible. The VirtualBox, the VMware Workstation, or the KVM/libvirt are the options.

# KVM/libvirt on Debian/Ubuntu
sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients virtinst virt-manager
sudo systemctl enable --now libvirtd
sudo usermod -aG libvirt,kvm "$USER"
# Log out and log back in for the group change

# Verify
virsh --version
virt-manager  # The GUI

The qemu-kvm is the hardware emulation. The libvirt-daemon-system is the daemon. The virtinst is the CLI for the VM creation. The virt-manager is the GUI. The usermod adds the user to the libvirt and the kvm groups .

The VM creation with the virt-install.

# Create the lab VM
sudo virt-install \
  --name lab-node1 \
  --memory 4096 \
  --vcpus 2 \
  --disk size=40 \
  --os-variant ubuntu22.04 \
  --network network=default \
  --graphics none \
  --location http://ftp.ubuntu.com/ubuntu/dists/jammy/main/installer-amd64/

The --memory 4096 is the 4 GB. The --vcpus 2 is the 2 CPU. The --disk size=40 is the 40 GB. The --network network=default is the NAT network. The --graphics none is the text console .

The snapshot after the installation.

# Take the clean baseline snapshot
sudo virsh snapshot-create-as lab-node1 clean-baseline "Fresh install"

# List the snapshots
sudo virsh snapshot-list lab-node1

# Revert after the experiments
sudo virsh snapshot-revert lab-node1 clean-baseline

The snapshot-create-as creates the named snapshot. The snapshot-revert restores the clean state. The snapshot is the fast reset .


b. The multi-node networking

The multiple VMs must communicate. The KVM default network is the NAT (the virbr0, the 192.168.122.0/24). The VMs on the default network can reach the internet and each other. The host-only network is the alternative for the isolated lab.

# The default network (NAT)
sudo virsh net-list --all
# Name      State    Autostart
# default   active   yes

# The VMs on the default network get the IPs from the virbr0 DHCP
sudo virsh net-dhcp-leases default

The virsh net-dhcp-leases shows the assigned IPs. The VMs on the default network can SSH to each other. The /etc/hosts on each VM must list the other VMs for the name resolution .

The host-only network for the isolated lab.

# Define the host-only network
sudo virsh net-define /dev/stdin <<EOF
<network>
  <name>host-only</name>
  <bridge name='virbr1'/>
  <ip address='192.168.100.1' netmask='255.255.255.0'/>
</network>
EOF

sudo virsh net-start host-only
sudo virsh net-autostart host-only

The host-only network has no internet. The VMs communicate only with each other and the host. The isolated lab is the correct for the DNS, the DHCP, and the PXE scenarios where the internet is the distraction.


c. The cloud instances and the Linux Foundation labs

The cloud instances are the alternative when the local hardware is the insufficient.

# DigitalOcean droplet (the example)
doctl compute droplet create lab-node1 \
  --size s-2vcpu-4gb \
  --image ubuntu-22-04-x64 \
  --region nyc1 \
  --ssh-keys $(doctl compute ssh-key list --format ID --no-header | head -1)

The s-2vcpu-4gb is the 2 CPU and the 4 GB. The ubuntu-22-04-x64 is the OS. The --ssh-keys is the key for the access. The cloud instances are the cheap per-hour, and the multi-system networking is the easy .

The Linux Foundation labs are the exam-like environment. The included with the some courses. The preconfigured, the closest to the exam interface. The most convenient and the most expensive .

The LFCE-specific Vagrant environment.

# The lfce-vagrant-env (the community)
git clone https://github.com/lrakai/lfce-vagrant-env.git
cd lfce-vagrant-env
bash up_exam.sh
# The environment: box, node1, node2
# The /etc/hosts on each node has the others

The lfce-vagrant-env is the CentOS 7 simulation. The box is the starting node. The node1 and the node2 are the targets. The ssh from the box to the others. The sudo -i for the root. The environment is the closest to the LFCE exam .


Complete Example Session

# ============================================
# PART 1: INSTALL KVM
# ============================================

sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients virtinst virt-manager
sudo systemctl enable --now libvirtd
sudo usermod -aG libvirt,kvm "$USER"
# ============================================
# PART 2: CREATE THE VM
# ============================================

sudo virt-install --name lab-node1 --memory 4096 --vcpus 2 --disk size=40 --os-variant ubuntu22.04 --network network=default --graphics none --location http://ftp.ubuntu.com/ubuntu/dists/jammy/main/installer-amd64/
# ============================================
# PART 3: SNAPSHOT
# ============================================

sudo virsh snapshot-create-as lab-node1 clean-baseline "Fresh install"
# ============================================
# PART 4: CREATE THE SECOND NODE
# ============================================

sudo virt-install --name lab-node2 --memory 4096 --vcpus 2 --disk size=40 --os-variant ubuntu22.04 --network network=default --graphics none --location http://ftp.ubuntu.com/ubuntu/dists/jammy/main/installer-amd64/
# ============================================
# PART 5: CHECK THE NETWORK
# ============================================

sudo virsh net-dhcp-leases default
# The IPs of the two nodes
# ============================================
# PART 6: THE HOSTS FILE
# ============================================

# On lab-node1
echo "192.168.122.10 lab-node1" | sudo tee -a /etc/hosts
echo "192.168.122.11 lab-node2" | sudo tee -a /etc/hosts

# On lab-node2
echo "192.168.122.10 lab-node1" | sudo tee -a /etc/hosts
echo "192.168.122.11 lab-node2" | sudo tee -a /etc/hosts
# ============================================
# PART 7: THE SSH TEST
# ============================================

ssh user@lab-node2 hostname
# lab-node2
# ============================================
# PART 8: THE LFCE VAGRANT ENV
# ============================================

git clone https://github.com/lrakai/lfce-vagrant-env.git
cd lfce-vagrant-env
bash up_exam.sh
# The box, node1, node2
# ============================================
# PART 9: THE REVERT
# ============================================

sudo virsh snapshot-revert lab-node1 clean-baseline
sudo virsh snapshot-revert lab-node2 clean-baseline

The nine parts trace the lab setup: the KVM install, the VM creation, the snapshot, the second node, the network check, the hosts file, the SSH test, the LFCE Vagrant, and the revert.


Quick Reference

Hypervisor Options

HypervisorPlatformCost
VirtualBoxWindows, Linux, macOSFree
VMware WorkstationWindows, LinuxPaid
KVM/libvirtLinuxFree

VM Specifications

ResourceMinimumRecommended
CPU22 per VM
RAM4 GB4 GB per VM
Disk20 GB40 GB per VM
NetworkNATNAT + host-only

Network Types

TypePurpose
NAT (default)Internet access
Host-onlyIsolated inter-VM
BridgedThe direct network

Snapshot Commands

CommandPurpose
snapshot-create-asCreate the snapshot
snapshot-listList the snapshots
snapshot-revertRestore the state

Alternatives

OptionCostBest For
Local VMsFreeThe maximum control
Cloud instancesPer-hourThe multi-system
LF Foundation labsIncluded/PaidThe exam-like

Best Practices

โœ… Do This:

sudo virsh snapshot-create-as lab-node1 clean-baseline
<!-- Take the snapshot before the experiments -->     # โœ…
sudo usermod -aG libvirt,kvm "$USER"
<!-- Add the user to the groups for the VM management --> # โœ…
git clone https://github.com/lrakai/lfce-vagrant-env.git
<!-- Use the LFCE-specific Vagrant environment -->    # โœ…

โŒ Don’t Do This:

# Use the single VM for the multi-service scenarios
<!-- The integration is not tested -->               # โŒ
# Skip the snapshot
<!-- The mistake requires the full reinstall -->     # โŒ
# Use the production machine for the lab
<!-- The destructive changes are the risk -->        # โŒ

Common Pitfalls

PitfallWhy It HappensFix
VMs cannot ping each otherNo the shared networkUse the default or the host-only
The lab is the slowThe insufficient RAMThe 16 GB host, the 4 GB per VM
The snapshot is the missingNo the clean baselinesnapshot-create-as
The KVM permission deniedNo the libvirt groupusermod -aG libvirt
The LFCE Vagrant failsThe VirtualBox missingInstall the VirtualBox

Real-World Examples

1. Install KVM

sudo apt install qemu-kvm libvirt-daemon-system virtinst

2. Create VM

sudo virt-install --name lab1 --memory 4096 --vcpus 2 --disk size=40

3. Snapshot

sudo virsh snapshot-create-as lab1 clean

4. List Leases

sudo virsh net-dhcp-leases default

5. Hosts File

echo "192.168.122.10 lab1" >> /etc/hosts

6. SSH Test

ssh user@lab1 hostname

7. LFCE Vagrant

git clone https://github.com/lrakai/lfce-vagrant-env.git

8. Start the Exam Env

bash up_exam.sh

9. Revert

sudo virsh snapshot-revert lab1 clean

10. Cloud Instance

doctl compute droplet create lab1 --size s-2vcpu-4gb

Visual

The Local Lab Topology

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Host (16 GB RAM, 100 GB disk)               โ”‚
โ”‚  โ”œโ”€โ”€ Hypervisor (KVM/libvirt)                โ”‚
โ”‚  โ”‚   โ”œโ”€โ”€ lab-node1 (4 GB, 40 GB)             โ”‚
โ”‚  โ”‚   โ”œโ”€โ”€ lab-node2 (4 GB, 40 GB)             โ”‚
โ”‚  โ”‚   โ””โ”€โ”€ lab-node3 (4 GB, 40 GB)             โ”‚
โ”‚  โ”œโ”€โ”€ virbr0 (NAT, 192.168.122.0/24)          โ”‚
โ”‚  โ””โ”€โ”€ virbr1 (host-only, 192.168.100.0/24)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The LFCE Vagrant Environment

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  box (the starting node)                     โ”‚
โ”‚  โ”œโ”€โ”€ ssh โ†’ node1                             โ”‚
โ”‚  โ”œโ”€โ”€ ssh โ†’ node2                             โ”‚
โ”‚  โ””โ”€โ”€ /etc/hosts with all the nodes           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ItemValue
HypervisorVirtualBox, VMware, KVM
VM specs2 CPU, 4 GB RAM, 40 GB disk
NetworkNAT + host-only
SnapshotClean baseline
LFCE Vagrantlfce-vagrant-env
CloudThe multi-system alternative
LF labsThe exam-like

Key takeaways:

  • The lab is the mandatory prerequisite. The performance-based exam requires the hands-on practice. The local VMs with the hypervisor are the free and the flexible. The multi-system scenarios require the multiple VMs .
  • The snapshot is the fast reset. The advanced scenarios involve the destructive changes. The snapshot-create-as before the experiments, the snapshot-revert after. The clean baseline is the recovery .
  • The multi-node networking is the requirement. The DNS, the DHCP, the PXE, and the auth are the integration scenarios. The VMs must communicate. The default network or the host-only network provides the connectivity .
  • The LFCE-specific Vagrant is the closest. The lfce-vagrant-env creates the CentOS 7 simulation with the box, the node1, and the node2. The environment mirrors the exam .
  • The cloud is the scalable alternative. The AWS, the DigitalOcean, the GCP. The cheap per-hour and the multi-system. The Linux Foundation labs are the most convenient but the most expensive .

Remember: The lab is the environment. The VMs are the nodes. The network is the connectivity. The snapshot is the reset. The LFCE Vagrant is the simulation. The cloud is the scale. The exam tests the hands-on skills, and the lab is where the skills are built.

Was this helpful?


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!