This repository provides cross-platform scripts to set up a comprehensive RHCE (Red Hat Certified Engineer) practice environment using Multipass and Vagrant. Perfect for preparing for RHCE8 exams and future RHCE9 certification.
Create a realistic RHCE exam simulation environment with:
- Multiple RHEL 8 systems for hands-on practice
- Ansible control node for automation tasks
- Repository server for package management
- Storage configuration for system administration tasks
- Network isolation mimicking exam conditions
The practice environment includes 7 virtual machines configured specifically for RHCE exam scenarios:
| VM | Hostname | IP Address | Role | RAM | Purpose |
|---|---|---|---|---|---|
| repo | repo.lab.example.com | 192.168.56.199 | Repository Server | 1GB | YUM/DNF repository, HTTP/FTP services |
| control | control.lab.example.com | 192.168.56.200 | Ansible Control | 2GB | Ansible automation, exam control node |
| node1 | node1.lab.example.com | 192.168.56.201 | Managed Node | 1GB | Target for automation tasks |
| node2 | node2.lab.example.com | 192.168.56.202 | Managed Node | 1GB | Target for automation tasks |
| node3 | node3.lab.example.com | 192.168.56.203 | Managed Node | 1GB | Target for automation tasks |
| node4 | node4.lab.example.com | 192.168.56.204 | Managed Node | 1GB | Target for automation tasks |
| node5 | node5.lab.example.com | 192.168.56.205 | Managed Node | 1GB | Target for automation tasks |
- User and group management
- File permissions and ACLs
- System services and systemd
- Process management
- Log file analysis
- System monitoring and performance tuning
- Network configuration
- Firewall management (firewalld)
- SELinux configuration
- YUM/DNF repository configuration
- Package installation and updates
- Local repository creation
- Software management automation
- Disk partitioning and formatting
- LVM (Logical Volume Management)
- File system creation and mounting
- Swap configuration
- Storage automation with Ansible
- Playbook creation and execution
- Inventory management
- Variable usage and templating
- Conditional tasks and loops
- Role creation and management
- Vault for sensitive data
- Error handling and debugging
- HTTP/HTTPS configuration
- FTP services
- NFS shares
- SSH configuration and key management
- Time synchronization (chronyd)
- Firewall rules automation
- SELinux policy management
- User authentication and sudo
- SSH security hardening
- File and directory permissions
Host System (Windows/macOS/Linux)
βββ Multipass VM (Ubuntu 20.04)
βββ VirtualBox + Vagrant
βββ repo (192.168.56.199)
βββ control (192.168.56.200)
βββ node1 (192.168.56.201)
βββ node2 (192.168.56.202)
βββ node3 (192.168.56.203)
βββ node4 (192.168.56.204)
βββ node5 (192.168.56.205)
Each managed node includes additional storage for hands-on practice with disk management, LVM, and file systems:
| VM | Primary Disk | Secondary Disk | Size | RHCE Practice Areas |
|---|---|---|---|---|
| node1 | /dev/sda (system) | /dev/sdb | 5GB | LVM, file systems, mounting |
| node2 | /dev/sda (system) | /dev/sdb | 200MB | Small volume management |
| node3 | /dev/sda (system) | /dev/sdb | 500MB | Partition management |
| node4 | /dev/sda (system) | /dev/sdb | 200MB | Swap configuration |
| node5 | /dev/sda (system) | /dev/sdb | 5GB | Advanced LVM scenarios |
- CPU: 4+ cores (8 cores recommended for smooth performance)
- RAM: 12GB+ (16GB recommended when all VMs running)
- Storage: 50GB+ free space (100GB recommended)
- Network: Internet connection for initial setup
- Basic Linux command line proficiency
- Understanding of RHEL/CentOS systems
- Familiarity with text editors (vim/nano)
- Basic networking concepts
-
Download all scripts to the same directory:
windows-setup.ps1setup-vm.sh
-
Run PowerShell as Administrator
-
Execute the setup script:
# Navigate to the directory containing the scripts cd C:\path\to\scripts .\windows-setup.ps1
-
Access your RHCE practice environment:
cd $env:USERPROFILE\vagrant-multipass-lab .\access-vm.ps1
-
Download all scripts to the same directory:
macos-setup.shsetup-vm.sh
-
Run the setup script:
chmod +x macos-setup.sh ./macos-setup.sh
-
Access your RHCE practice environment:
cd ~/vagrant-multipass-lab ./access-vm.sh
-
Download all scripts to the same directory:
linux-setup.shsetup-vm.sh
-
Run the setup script:
chmod +x linux-setup.sh ./linux-setup.sh
-
Access your RHCE practice environment:
cd ~/vagrant-multipass-lab ./access-vm.sh
# Access the Multipass VM
./access-vm.sh # (Linux/macOS) or .\access-vm.ps1 (Windows)
# Inside the VM, start the RHCE lab
cd ~/vagrant-projects/rhel-lab
./start-lab.sh
# Check all VMs are running
vagrant status# SSH to the Ansible control node
vagrant ssh control
# Verify Ansible connectivity to all managed nodes
ansible all -m ping
# Start practicing RHCE tasks
cd /vagrant/playbooks# Test Ansible inventory
ansible-inventory --list
# Run ad-hoc commands on managed nodes
ansible nodes -m shell -a "uptime"
ansible nodes -m yum -a "name=httpd state=present" --become
# Practice playbook execution
ansible-playbook playbooks/system-config.yml
ansible-playbook playbooks/user-management.yml
ansible-playbook playbooks/storage-setup.yml# From the host (Multipass VM)
vagrant ssh node1 # Practice system administration
vagrant ssh node2 # Test configurations
vagrant ssh node3 # Verify automation results- Multipass: VM management platform
- Vagrant: VM orchestration tool
- Platform-specific package managers (Chocolatey/Homebrew/distro packages)
- Ubuntu 20.04 LTS
- VirtualBox: Virtualization platform
- Vagrant: VM orchestration
- Ansible: Configuration management
- Development tools: Git, Python, build essentials
- Lab environment: Pre-configured Vagrantfile and scripts
project-directory/
βββ windows-setup.ps1 # Windows setup script
βββ macos-setup.sh # macOS setup script
βββ linux-setup.sh # Linux setup script
βββ setup-vm.sh # General VM setup script
βββ README.md # This file
βββ original-Vagrantfile # Your original Vagrantfile
# After running setup scripts:
~/vagrant-multipass-lab/ # User project directory
βββ access-vm.ps1/.sh # Quick VM access scripts
βββ manage-vm.ps1/.sh # VM management scripts
βββ (Windows users: see %USERPROFILE%\vagrant-multipass-lab\)
# Inside Multipass VM:
~/vagrant-projects/rhel-lab/ # Lab environment
βββ Vagrantfile # Main Vagrant configuration
βββ ansible.cfg # Ansible configuration
βββ inventory # Ansible inventory
βββ start-lab.sh # Start all VMs
βββ stop-lab.sh # Stop all VMs
βββ playbooks/ # Ansible playbooks
β βββ master.yml # Main playbook
βββ disk-*.vdi # VM disk files (created automatically)
Before running any setup script, ensure you have:
-
All required scripts downloaded in the same directory:
- Platform-specific setup script (
windows-setup.ps1,macos-setup.sh, orlinux-setup.sh) - General VM setup script (
setup-vm.sh)
- Platform-specific setup script (
-
Administrative privileges (Windows) or sudo access (Linux/macOS)
-
Adequate system resources (see Resource Requirements section)
-
Internet connection for downloading packages (setup scripts work offline after initial setup)
-
Access the Multipass VM:
# Windows .\access-vm.ps1 # macOS/Linux ./access-vm.sh
-
Navigate to the lab directory:
cd ~/vagrant-projects/rhel-lab
-
Start all VMs:
./start-lab.sh
Or start individual VMs:
vagrant up repo vagrant up control vagrant up node1 # etc.
# Check status of all VMs
vagrant status
# SSH into specific VMs
vagrant ssh repo
vagrant ssh control
vagrant ssh node1
# Stop all VMs
./stop-lab.sh
# or
vagrant halt
# Destroy all VMs (careful!)
vagrant destroy# Check Multipass VM status
multipass list
# Start/stop the Multipass VM
multipass start vagrant-primary
multipass stop vagrant-primary
# Mount host directory into VM
multipass mount /path/to/your/files vagrant-primary:/mnt/host
# Get VM information
multipass info vagrant-primaryAll VMs are connected via a private network (192.168.56.0/24):
| VM | IP Address | Role |
|---|---|---|
| repo | 192.168.56.199 | Repository/Package server |
| control | 192.168.56.200 | Ansible control node |
| node1 | 192.168.56.201 | Worker node |
| node2 | 192.168.56.202 | Worker node |
| node3 | 192.168.56.203 | Worker node |
| node4 | 192.168.56.204 | Worker node |
| node5 | 192.168.56.205 | Worker node |
The environment includes pre-configured Ansible setup:
[control]
192.168.56.200
[repo]
192.168.56.199
[nodes]
192.168.56.201
192.168.56.202
192.168.56.203
192.168.56.204
192.168.56.205
[all:vars]
ansible_user=vagrant
ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
ansible_ssh_common_args='-o StrictHostKeyChecking=no'# From the control VM
vagrant ssh control
# Test connectivity
ansible all -m ping
# Run the main playbook
ansible-playbook playbooks/master.yml
# Run ad-hoc commands
ansible nodes -m shell -a "uptime"Objective: Create users and groups across all managed nodes using Ansible
# Practice commands on control node
ansible-playbook playbooks/user-management.yml
ansible managed_nodes -m shell -a "getent passwd john"
ansible managed_nodes -m shell -a "groups jane"Objective: Configure LVM and filesystems on managed nodes
# Practice commands
ansible-playbook playbooks/storage-management.yml
ansible managed_nodes -m shell -a "lsblk"
ansible managed_nodes -m shell -a "df -h /mnt/data"Objective: Deploy and configure Apache web servers
# Practice commands
ansible-playbook playbooks/network-services.yml
ansible web_servers -m uri -a "url=http://{{ ansible_host }}"Objective: Configure firewall and SELinux policies
# Practice ad-hoc security commands
ansible managed_nodes -m firewalld -a "service=ssh permanent=yes state=enabled"
ansible managed_nodes -m shell -a "getenforce"
ansible managed_nodes -m selinux -a "policy=targeted state=enforcing"Objective: Manage software packages and repositories
# Practice package management
ansible managed_nodes -m yum_repository -a "name=epel description='EPEL Repository' baseurl=https://download.fedoraproject.org/pub/epel/8/Everything/x86_64/ enabled=yes gpgcheck=no"
ansible managed_nodes -m yum -a "name=htop state=present"- 30-minute sprints: Focus on single tasks (user management, storage, etc.)
- 2-hour simulations: Complete multiple related tasks
- 4-hour mock exams: Full RHCE exam simulation
- Create and run playbooks for system configuration
- Use variables, loops, and conditionals
- Implement error handling and when conditions
- Create and use Ansible roles
- Manage Ansible Vault for sensitive data
- Use Ansible Galaxy for community roles
- Configure network settings and hostname
- Manage system services with systemd
- Configure time synchronization
- Set up log rotation and analysis
- Configure kernel parameters
- Configure SELinux policies and contexts
- Manage firewall rules with firewalld
- Set up SSH key-based authentication
- Configure sudo access and policies
- Implement file and directory permissions
Deploy a complete web application stack:
# Database tier (node3, node4)
ansible database_servers -m yum -a "name=mariadb-server state=present"
ansible database_servers -m systemd -a "name=mariadb state=started enabled=yes"
# Web tier (node1, node2)
ansible web_servers -m yum -a "name=httpd,php,php-mysqlnd state=present"
ansible web_servers -m systemd -a "name=httpd state=started enabled=yes"
# Load balancer tier (node5)
ansible file_servers -m yum -a "name=haproxy state=present"Create automated backup strategies:
# Practice cron jobs and rsync
ansible managed_nodes -m cron -a "name='Daily backup' minute=0 hour=2 job='rsync -av /home/ /backup/'"Set up centralized logging:
# Configure rsyslog forwarding
ansible managed_nodes -m lineinfile -a "path=/etc/rsyslog.conf line='*.* @@192.168.56.200:514'"# Debug SSH connectivity
ansible all -m ping -vvv
# Check SSH keys
ansible all -m shell -a "ssh-keygen -f ~/.ssh/known_hosts -R 192.168.56.201"
# Verify inventory
ansible-inventory --list# Check available disks
ansible managed_nodes -m shell -a "lsblk"
# Verify LVM configuration
ansible managed_nodes -m shell -a "pvdisplay"
ansible managed_nodes -m shell -a "vgdisplay"
ansible managed_nodes -m shell -a "lvdisplay"# Check service status across nodes
ansible managed_nodes -m systemd -a "name=httpd state=started" --check
# View service logs
ansible web_servers -m shell -a "journalctl -u httpd --no-pager -n 20"# Test network connectivity
ansible all -m shell -a "ping -c 1 192.168.56.200"
# Check firewall rules
ansible managed_nodes -m shell -a "firewall-cmd --list-all"
# Verify port accessibility
ansible managed_nodes -m shell -a "ss -tuln | grep :80"# Check Multipass VM status
multipass list
# Restart Multipass VM
multipass restart vagrant-primary
# Check VirtualBox inside VM
multipass exec vagrant-primary -- vboxmanage list vms# Check VM network configuration
vagrant ssh control
ip addr show
# Test connectivity between VMs
ping 192.168.56.199 # repo
ping 192.168.56.201 # node1# Check available space in Multipass VM
multipass exec vagrant-primary -- df -h
# Check VirtualBox disk usage
multipass exec vagrant-primary -- ls -la ~/vagrant-projects/rhel-lab/disk-*.vdi- Increase Multipass VM resources:
multipass stop vagrant-primary multipass set vagrant-primary --cpus 6 multipass set vagrant-primary --memory 8G multipass start vagrant-primary
- PowerShell Execution Policy: Run
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser - Chocolatey Issues: Restart PowerShell as Administrator after installation
- Hyper-V Conflicts: Disable Hyper-V if using VirtualBox
- Homebrew Permissions: Check ownership of
/opt/homebrew(M1/M2) or/usr/local(Intel) - Security Permissions: Allow Multipass in System Preferences > Security & Privacy
- Rosetta 2: May be needed for some Intel-based tools on Apple Silicon
- Snap Installation: Some distributions require manual snapd setup
- Group Membership: Log out and back in after installation for group changes
- SELinux: May need configuration on RHEL/CentOS systems
- CPU: 4 cores (8 cores recommended)
- RAM: 8GB (16GB recommended)
- Storage: 50GB free space (100GB recommended)
- Network: Internet connection for downloads
- Multipass VM: 4 CPUs, 4GB RAM, 20GB disk
- Each Vagrant VM: 1-2GB RAM (repo=1GB, control=2GB, nodes=1GB each)
- Total when all running: ~12GB RAM, ~60GB disk
Edit the Vagrantfile to modify VM resources:
# Increase memory for specific VMs
config.vm.define "control" do |control|
control.vm.provider :virtualbox do |vb|
vb.memory = "4096" # Change from 2048 to 4096
vb.cpus = 2 # Add CPU configuration
end
endAdd new VM definitions to the Vagrantfile:
config.vm.define "node6" do |node6|
node6.vm.box = "rdbreak/rhel8node"
node6.vm.network "private_network", ip: "192.168.56.206"
node6.vm.provider "virtualbox" do |node6|
node6.memory = "1024"
end
endModify the Ansible playbooks in playbooks/ directory to customize VM configuration.
- Default Vagrant SSH keys are used (insecure for production)
- VMs use default passwords where applicable
- Network is isolated to host-only adapter
- This environment is intended for lab/development use only
- Master Ansible fundamentals - This is 60%+ of the exam
- Practice daily - Consistency beats cramming
- Time management - Practice with time limits
- Documentation skills - Learn to read man pages quickly
- Error troubleshooting - Practice debugging failed tasks
- Week 1-2: Basic Ansible (playbooks, modules, inventory)
- Week 3-4: Advanced Ansible (roles, variables, templates, vault)
- Week 5-6: System administration automation
- Week 7-8: Mock exams and time management
# Ansible essentials
ansible-doc <module> # Module documentation
ansible-playbook --syntax-check # Validate syntax
ansible-playbook --check # Dry run
ansible-vault create/edit/view # Manage encrypted files
ansible-galaxy install # Install roles
# System administration
systemctl status/start/stop/enable # Service management
firewall-cmd --permanent --add-service # Firewall rules
semanage fcontext -a -t # SELinux contexts
lvextend/resize2fs/xfs_growfs # Storage expansionTo improve VM performance during practice:
# Allocate more resources to Multipass VM
multipass stop vagrant-primary
multipass set vagrant-primary --cpus 8
multipass set vagrant-primary --memory 16G
multipass start vagrant-primary
# Or start fewer VMs for focused practice
vagrant up control repo node1 node2 # Only 4 VMs instead of 7- Create new playbooks in
playbooks/directory - Add inventory groups for specific scenarios
- Document practice objectives and commands
- Test scenarios across all managed nodes
- Add more real-world RHCE scenarios
- Include timing guidelines for each task
- Provide sample exam questions
- Add troubleshooting guides
- Ansible Galaxy - Community roles and collections
- Red Hat Learning Community - Free training materials
- Practice Labs - Browser-based practice
For issues, questions, or contributions:
- Check the troubleshooting section above
- Review official Red Hat documentation
- Join RHCE study groups and forums
- Open an issue in this repository
To contribute improvements:
- Fork the repository
- Create a feature branch
- Make your changes
- Test on multiple platforms
- Submit a pull request
This RHCE practice environment is provided for educational purposes only. It simulates exam conditions but does not guarantee exam success. Always refer to official Red Hat training materials and documentation for authoritative information.
Good luck with your RHCE certification journey! ππ
- Initial cross-platform setup scripts
- Support for Windows, macOS, and Linux
- Multipass-based virtualization
- Pre-configured RHEL 8 lab environment
- Ansible integration
- Storage configuration for lab exercises
- RHCE-focused practice scenarios and documentation