How to Set Up a RHEL 9 Virtual Lab for RHCSA Practice.pdf
1. How to Set Up a RHEL 9 Virtual Lab for RHCSA Practice
A Complete Step‐by‐Step Guide for Red Hat Certified System Administrator Preparation
⠡ Master RHCSA Skills at rhcsa.guru
Published by RHCSA Guru | Follow us on LinkedIn
Published: June 25, 2025
Published by: RHCSA Guru
Target Audience: RHCSA Candidates, Linux System Administrators
Difficulty Level: Beginner to Intermediate
Estimated Setup Time: 3‐4 hours ﴾with all enhancements﴿
Ready to Ace Your RHCSA Exam?
Join thousands of successful RHCSA candidates who practiced with our comprehensive lab exercises, mock exams, and hands‐on
scenarios at rhcsa.guru
Follow RHCSA Guru on LinkedIn for daily tips, updates, and success stories!
Objective
This comprehensive guide provides a step‐by‐step approach to creating a fully functional RHCSA ﴾Red Hat Certified System
Administrator﴿ practice lab using VirtualBox and RHEL 9 on your local machine. You'll learn to simulate real‐world scenarios,
practice key Linux administration tasks, and prepare effectively for the RHCSA exam without risking your main operating system.
Why a Virtual Lab Is Essential
Creating a virtual lab environment offers several critical advantages for RHCSA certification preparation:
Safe Practice Environment: Practice RHCSA objectives without risking damage to your real operating system
Unlimited Experimentation: Test configurations, commands, and system settings without fear of permanent damage
Repetitive Learning: Repeat tasks as many times as needed to achieve mastery
Real‐World Simulation: Replicate enterprise setups, complex network configurations, and multi‐server environments
Container Practice: Safe environment for Podman and container management tasks
Network Services Testing: Multi‐VM setup for realistic network service configuration
Page: 1 of 16
2. System Requirements
Component Minimum Recommended Multi‐VM Setup
RAM 4 GB 8 GB 16 GB ﴾for 3 VMs﴿
Disk Space 30 GB 50 GB 100+ GB Free
CPU Dual‐Core Quad‐Core 6+ Cores recommended
Operating System Windows 10/11, macOS 10.15+, Linux ﴾Ubuntu 20.04+﴿
Step‐by‐Step Lab Setup Guide
1 Download RHEL 9 ISO ﴾Free & Legal﴿
Red Hat provides free access to RHEL 9 for developers and students:
Visit the Red Hat Developer Portal ﴾developer.redhat.com﴿
Create a free Red Hat Developer account and log in
Navigate to the Download section
Select "Download RHEL 9 DVD ISO"
Save the ISO file to a known location on your machine
Note: The ISO file is approximately 8‐9 GB. Ensure you have sufficient bandwidth and storage space. The developer
subscription includes support for up to 16 systems.
Page: 2 of 16
3. 2 Install VirtualBox
Visit the official VirtualBox download page ﴾virtualbox.org﴿
Choose the appropriate version for your OS ﴾Windows, macOS, or Linux﴿
Run the installer and follow default installation settings
Recommended: Install the Extension Pack for enhanced functionality:
USB 2.0 and 3.0 support
VirtualBox RDP support
Disk encryption and NVMe support
3 Create New Virtual Machine
Launch VirtualBox and click New
Enter VM name: rhel9server
Set Type: Linux
Set Version: Red Hat ﴾64‐bit﴿
Enable Skip Unattended Installation for manual setup
Click Next to continue
Page: 3 of 16
4. 4 Allocate System Resources
RAM: 2048 MB ﴾2 GB minimum, 4 GB recommended for GUI﴿
CPU: 2 cores ﴾recommended for better performance﴿
Disk Space: 50 GB ﴾dynamically allocated﴿
Choose VDI ﴾VirtualBox Disk Image﴿ format
Select Dynamically allocated to save physical disk space
Performance Tip: For better performance, allocate 50% of your available RAM to the VM, but not less than 2GB or more than
8GB for a single VM.
5 Configure Advanced VM Settings
Before starting the VM, configure these important settings:
Display Settings
Go to Settings → Display
Video Memory: 128 MB
Enable 3D Acceleration
Graphics Controller: VMSVGA
Page: 4 of 16
5. Graphics Controller: VMSVGA
Network Configuration
Go to Settings → Network
Adapter 1: Enable, Attached to NAT ﴾for internet access﴿
Adapter 2: Enable, Attached to Host‐only Adapter ﴾for VM‐to‐VM communication﴿
Storage Configuration
Go to Settings → Storage
Add additional virtual disks for practice:
Add 20GB disk for LVM practice
Add 10GB disk for filesystem practice
6 Mount RHEL 9 ISO
In Settings → Storage
Under Controller: IDE, click the Empty CD icon
Select Choose a disk file from the dropdown
Browse to your downloaded RHEL 9 ISO file
Click OK to confirm and save settings
7 Install RHEL 9 with RHCSA‐Optimized Configuration
Start the VM by clicking Start Page: 5 of 16
6. Start the VM by clicking Start
From boot menu, select Install Red Hat Enterprise Linux 9
Configure installation options:
Language: English ﴾or preferred language﴿
Keyboard: Select appropriate layout
Time and Date: Choose your timezone
Installation Source: Auto‐detected installation source
Software Selection: Workstation ﴾includes GUI and development tools﴿
Page: 6 of 16
7. Red Hat Subscription Manager
Connect to Red Hat using your developer account credentials to register the system and enable repositories.
Custom Disk Partitioning ﴾RHCSA Practice﴿
Select Custom partitioning for hands‐on practice:
/boot: 1024 MB ﴾ext4﴿ ‐ Standard boot partition
/: 35 GB ﴾xfs﴿ ‐ Root filesystem
/home: 8 GB ﴾ext4﴿ ‐ Separate home partition
swap: 4 GB ‐ Swap partition
LVM Practice: Leave additional disks unpartitioned for later practice
User Configuration
Set Root Password ﴾use a strong password like "RedHat123!"﴿
Create a regular user account ﴾e.g., "student"﴿ Page: 7 of 16
8. Set Root Password ﴾use a strong password like "RedHat123!"﴿
Create a regular user account ﴾e.g., "student"﴿
Enable administrator privileges for the user ﴾sudo access﴿
Set user password ﴾e.g., "student123"﴿
8 Complete Installation and First Boot
Review installation summary
Click Begin Installation
Wait for installation to complete ﴾typically 20‐40 minutes﴿
Remove installation media when prompted
Click Reboot System
Complete the initial setup wizard
Log in with your created user credentials
Page: 8 of 16
9. 9 Essential Post‐Installation Configuration
Enable SSH Service ﴾Critical for RHCSA﴿
SSH is essential for remote system administration and RHCSA exam tasks:
Install OpenSSH server: sudo dnf install y opensshserver
Start and enable SSH service: sudo systemctl enable now sshd
Configure firewall for SSH: sudo firewallcmd permanent addservice=ssh
Reload firewall configuration: sudo firewallcmd reload
Verify SSH is running: sudo systemctl status sshd
Install Essential RHCSA Packages
Development tools: sudo dnf groupinstall y "Development Tools"
Container tools: sudo dnf install y podman buildah skopeo
Network diagnostic tools: sudo dnf install y nettools tcpdump wiresharkcli nmap
Text editors: sudo dnf install y vim nano
System monitoring: sudo dnf install y htop iotop lsof
Web services: sudo dnf install y httpd nginx
Security tools: sudo dnf install y policycoreutilspythonutils
Configure Container Management ﴾New RHCSA Requirement﴿
Container management with Podman is now a critical RHCSA exam component:
Enable podman service: sudo systemctl enable now podman
Configure container registries: sudo vi /etc/containers/registries.conf
Test container functionality: podman run helloworld
Practice rootless containers: podman run rm d nginx
Enable lingering for user: sudo loginctl enablelinger student
Configure SSH Key Authentication
Generate SSH keys: sshkeygen t rsa b 4096
Copy public key to authorized_keys: cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
Set proper permissions: chmod 600 ~/.ssh/authorized_keys
Test key‐based authentication
10 Create Host‐Only Network for Multi‐VM Setup
Multi‐VM Setup is Essential: RHCSA exam scenarios often involve multiple systems. This setup enables realistic network
service practice.
Configure VirtualBox Host‐Only Network
Open VirtualBox → File → Host Network Manager Page: 9 of 16
10. Open VirtualBox → File → Host Network Manager
Click Create to add new host‐only network
Configure network settings:
Network: 192.168.56.0/24
DHCP Server: Enable
DHCP Range: 192.168.56.100‐200
Click Apply to save configuration
Configure Static IP on RHEL 9
Identify network interfaces: ip addr show
Configure static IP on host‐only adapter:
sudo nmcli con add type ethernet conname staticeth1 ifname enp0s8
sudo nmcli con modify staticeth1 ipv4.addresses 192.168.56.10/24
sudo nmcli con modify staticeth1 ipv4.method manual
sudo nmcli con up staticeth1
Verify connectivity: ping 192.168.56.1
11 Advanced Multi‐VM Architecture Setup
Recommended VM Configuration for Complete RHCSA Practice:
VM1 ‐ rhel9‐server ﴾192.168.56.10﴿:
Primary server for system administration
Web services ﴾httpd/nginx﴿
Container management practice
Storage and LVM configuration
VM2 ‐ rhel9‐client ﴾192.168.56.20﴿:
Client system for network services testing
SSH target practice
File sharing and NFS client
User management scenarios
VM3 ‐ rhel9‐services ﴾192.168.56.30﴿:
Database services ﴾MariaDB﴿
DNS and network services
Backup and recovery practice
Performance monitoring
Clone VMs for Multi‐VM Setup
Shutdown the original VM
Right‐click VM → Clone
Choose Full Clone
Rename appropriately ﴾rhel9‐client, rhel9‐services﴿
Configure unique IP addresses for each VM
Update hostnames: sudo hostnamectl sethostname rhel9client
Page: 10 of 16
11. Update hostnames: sudo hostnamectl sethostname rhel9client
12 Create Strategic VM Snapshots
Snapshots are crucial for safe RHCSA practice and quick recovery:
Power off your VM completely
In VirtualBox, select VM → Snapshots tab
Click Take Snapshot
Create these strategic snapshots:
"01‐Fresh‐Install" ‐ Clean RHEL 9 installation
"02‐Post‐Config" ‐ After basic configuration
"03‐Pre‐Practice" ‐ Before starting practice sessions
"04‐Exam‐Ready" ‐ Final configuration before mock exams
Pro Tip: Always take snapshots before practicing destructive operations like:
Partition management and LVM operations
System recovery and boot troubleshooting
SELinux configuration changes
Firewall and network service modifications
13 Configure RHCSA‐Specific Practice Environment
File Systems & Storage Practice Setup
Add additional virtual disks for LVM practice:
20GB disk for LVM volume groups
15GB disk for filesystem practice
10GB disk for swap and partition practice
Practice with different filesystem types:
Create ext4 filesystems: sudo mkfs.ext4 /dev/sdb1
Create xfs filesystems: sudo mkfs.xfs /dev/sdc1
Configure LVM: sudo pvcreate /dev/sdd
Configure disk quotas and mount options
Practice with fstab configuration
User & Group Management Setup
Create test users and groups for practice:
sudo useradd m testuser1
sudo groupadd developers
sudo usermod aG developers testuser1
Configure sudo access: sudo visudo
Set up password policies: sudo vi /etc/login.defs
Practice with user limits: sudo vi /etc/security/limits.conf
Page: 11 of 16
12. Set up password policies: sudo vi /etc/login.defs
Practice with user limits: sudo vi /etc/security/limits.conf
Network Services Configuration
Configure SSH key‐based authentication between VMs
Set up basic HTTP service:
sudo systemctl enable now httpd
sudo firewallcmd permanent addservice=http
sudo firewallcmd reload
Practice with SELinux contexts for web services
Configure network file sharing ﴾NFS﴿
Process & Service Management
Practice systemctl commands:
sudo systemctl listunitfiles
sudo systemctl enable now chronyd
sudo systemctl mask NetworkManager
Configure automatic service startup
Monitor system processes: ps aux | grep httpd
Analyze system logs: sudo journalctl u sshd
Container Management Practice
Practice basic container operations:
podman search nginx
podman pull nginx
podman run d name webserver p 8080:80 nginx
Create custom container images with Buildah
Configure container services with systemd
Practice rootless container management
Security Configuration
SELinux management:
sudo semanage fcontext a t httpd_exec_t "/custom/httpd"
sudo restorecon Rv /var/www/html
sudo setsebool P httpd_can_network_connect on
Firewall configuration:
sudo firewallcmd listall
sudo firewallcmd permanent addport=8080/tcp
SSH security hardening
14 Lab Validation and Testing
✅ Essential RHCSA Lab Functionality Checklist
Verify your lab setup meets all RHCSA practice requirements:
System Access & Authentication Page: 12 of 16
13. Verify your lab setup meets all RHCSA practice requirements:
System Access & Authentication
☐ SSH service running and accessible
☐ Key‐based authentication configured
☐ Sudo access properly configured
☐ Multiple user accounts created
Storage & File Systems
☐ Additional disks attached and recognized
☐ LVM tools installed and functional
☐ Multiple filesystem types available ﴾ext4, xfs﴿
☐ Disk quota tools installed
Network & Services
☐ Multi‐VM network connectivity established
☐ HTTP service installable and configurable
☐ Firewall service active and manageable
☐ DNS resolution working properly
Container Management
☐ Podman installed and functional
☐ Container images can be pulled and run
☐ Rootless containers working
☐ Container services can be created
Security & Monitoring
☐ SELinux enforcing and manageable
☐ System logs accessible via journalctl
☐ Process monitoring tools available
☐ Scheduled tasks ﴾cron﴿ functional
Quick Lab Verification Commands
Run these commands to verify your lab setup:
System Info: hostnamectl && uname r
Network: ip addr show && ss tuln
Storage: lsblk && df h
Services: systemctl listunitfiles state=enabled
Security: getenforce && firewallcmd listall
Containers: podman version && podman images
15 RHCSA Practice Scenarios Setup
Create Realistic Practice Scenarios
Set up common RHCSA exam scenarios in your lab:
Scenario 1: Web Server Deployment Page: 13 of 16
14. Set up common RHCSA exam scenarios in your lab:
Scenario 1: Web Server Deployment
Install and configure Apache HTTP server
Create virtual hosts for multiple domains
Configure SSL/TLS certificates
Set appropriate SELinux contexts
Configure firewall rules
Scenario 2: User Management & Security
Create user accounts with specific requirements
Configure password policies and account expiration
Set up group‐based permissions
Configure sudo access with restrictions
Implement SSH key‐based authentication
Scenario 3: Storage Management
Create and manage LVM logical volumes
Resize filesystems without data loss
Configure disk quotas for users
Set up swap space and manage priorities
Create and mount network filesystems
Scenario 4: Container Services
Deploy containerized applications
Create systemd service files for containers
Configure container networking and storage
Implement container security policies
Set up container image registries
16 Performance Optimization & Monitoring
⚡ Optimize Lab Performance
Configure VM settings for optimal performance:
Enable hardware acceleration in BIOS/UEFI
Adjust VM processor and memory allocation
Enable VT‐x/AMD‐V virtualization extensions
Optimize RHEL 9 for virtualization:
Install guest additions: sudo dnf install y VirtualBoxguestadditions
Configure kernel parameters for performance
Disable unnecessary services
Set Up System Monitoring
Configure system monitoring tools:
sudo dnf install y cockpit
sudo systemctl enable now cockpit.socket
Access web interface at https://192.168.56.10:9090 Page: 14 of 16