An RHCE v8 lab enviroment with practice exams.
If you are preparing for the RHCE v8 exam, this repo will help you create a lab environment and practice the exam objectives.
The repo contains Vagrant and Ansible files that will set up 1x control node (RHEL server with GUI), one local repo server, and 4x other nodes.
- control
- repo
- node1
- node2
- node3
- node4
The control node will have access to the local repo server and the other nodes, which will simulate the exam scenario.
See the Setup page for details instructions on how to install and configure the environment.
- Nodes - victorbrca/rhel84
- Control - victorbrca/rhel84-gui
- Repo - rdbreak/rhel8repo
User: vagrant Password: vagrant Sudo access: yes
- control
- control.ansi.example.com
- 192.168.55.200
- Gateway - 192.168.55.1
- DNS - 8.8.8.8
- node1
- node1.ansi.example.com
- 192.168.55.201
- Gateway - 192.168.55.1
- DNS - 8.8.8.8
- node2
- node2.ansi.example.com
- 192.168.55.202
- Gateway - 192.168.55.1
- DNS - 8.8.8.8
- node3
- node3.ansi.example.com
- 192.168.55.203
- Gateway - 192.168.55.1
- DNS - 8.8.8.8
- node4
- node4.ansi.example.com
- 192.168.55.204
- Gateway - 192.168.55.1
- DNS - 8.8.8.8
- repo
- repo.ansi.example.com
- 192.168.55.199
- Base and AppStream repos are available via:
http://repo.ansi.example.com/BaseOS
http://repo.ansi.example.com/AppStream
Use the commands below to control your environment with Vagrant:
vagrant up
- Boots and provisions the environmentvagrant destroy -f
- Shuts down and destroys the environmentvagrant halt
- Only shuts down the environment VMs (can be booted up withvagrant up
)vagrant suspend
- Puts the VMs in a suspended statevagrant resume
- Takes VMs out of a suspended state
Note
- The first time you run
vagrant up
it will download the box (VM image), so it will take a while. After that, recreating the VMs will be quicker as the images will already be local to your machine. - Once the VMs are created you can also use the VirtualBox Manager to control the VMS.
Use vagrant destroy -f
and vagrant up
to recreate the environment. You can also recreate a specific node by providing the node name to the two commands.
For example:
vagrant destroy -f node1
vagrant up node1
There are three ways to access the systems:
- With
vagrant ssh [node]
- Via VirtualBox Manager
- Using the built-in SSH client for you OS
ssh [email protected]
Tip
Add the IP addresses to your local host file if you want to connect to the guest systems with the hostname.
A few practice exams are available at the RHCE8 Practice Exams page.
- Exam Information - A collection of information for the RHCE exam.
- Study Resources - A list of books, courses, communities and external practice exams.
I highly recommend registering your control node (or all nodes) using free RHEL licenses that are provided with the Red Hat Developer Program (you can read more about it here). By doing that, you will be able to run full updates by adding Red Hat official repos, and much more.
- Register for the Red Hat Developer Program
- Register the control node to your new developer account using
subscritption-manager
(or using included playbooks - see below) - Optionally:
- Enable the 'CodeReady Linux Builder' repo
- Install/enable the EPEL repo
Once you have your Red Had Developer subscription, you can also register the control node with included playbooks, either before the build, or after building the environment.
First add your Red Hat username and password to:
roles/register-control-node/defaults/main.yml
---
# defaults file for register-control-node
username: ''
password: ''
Then use one of the two methods below.
Before building the environment, set the register_control
variable to true
:
playbooks/build-nodes.yml
vars:
- register_control: true
Then run vagrant up
as usual to build the environment.
Run the playbook register-control.yml
from the control node:
# ssh to the control node
vagrant ssh control
# Change into the /vagrant folder
cd /vagrant
# Run the playbook
ansible-playbook playbooks/register-control.yml
Running the vagrant up
environment build will fail If HyperV is installed on the Windows VirtualBox host.
Error is usually "VT-x is not available. (VERR_VMX_NO_VMX)" or similar, when the script attempts to boot the first VM.
Resolution seems to be either remove HyperV, or preventing its hypervisor from starting with the command below followed by a reboot:
bcdedit /set hypervisorlaunchtype off
The following error might appear when re-creating one or more VMs in VirtualBox:
Stderr: 0%...VBOX_E_FILE_ERROR
VBoxManage: error: Failed to create medium
VBoxManage: error: Could not create the medium storage unit 'rhce8env/disk-0-4.vdi'.
VBoxManage: error: VDI: cannot create image 'rhce8env/disk-0-4.vdi' (VERR_ALREADY_EXISTS)
If you have VirtualBox Manager open, check the disks in the 'Media' section and you might notice that a disk for a deleted VM is still listed. If the file itself doesn't exist, close the VirtualBox Manager and try running vagrant up
again.
Victor Mendonça
- Site - Victor Mendonça
- GitHub - victorbrca
- Twitter - @victorbrca
This project is a fork of the rdbreak/rhce8env project, but it has many extra features and modifications.
Exam 1 is a variation of the of the Lisenet: Ansible Sample Exam for RHCE EX294 and EX407.