Chapter 1: Build Your Practice Lab

Your first session and daily use

Phases 12 and 13. With the baseline saved, everything from here on is your own work. Run a first short session so you know the loop, then set up a one-command way into the lab from your own computer.

Phase 12 · A first practice session (~10 min)

  • Create a practice folder on workstation.
  • Change a server, then put it back with one command.

VM: create the practice folder

It lives on workstation, so resetting the servers never touches it. Get there with rht-vmctl ws.

mkdir -p ~/practice && cd ~/practice
echo "my first note" > notes.txt
ls -l

VM: change a server

Log in to servera, add a user and a file, and install a package. This is the kind of change every later chapter makes.

ssh student@servera
sudo useradd demo && sudo touch /root/demo-was-here
sudo dnf -y install nano
id demo
exit

Host: put the server back

On the Ubuntu host, reset servera to the clean baseline. It returns once the machine has booted.

rht-vmctl reset servera

Then check on workstation that the change is gone while your folder is still there:

ssh student@servera 'id demo'          # id: 'demo': no such user
ls ~/practice                          # notes.txt is still here

Host: keep what matters

Resetting workstation to clean removes ~/practice. Copy anything you want to keep to the host first:

lxc file pull --project rhce workstation/home/student/practice/notes.txt .

Daily use

Getting in

Getting into the lab: SSH to the host as usual, step into workstation with lxc exec, then work as you would on any server. The ssh rhce shortcut does the first two hops in one command.

On the host, rht-vmctl ws drops you at the student prompt on workstation. From your own computer, one SSH alias takes you straight there:

Host rhce
    HostName <HOST_LAN_IP>
    User <HOST_USER>
    RequestTTY yes
    RemoteCommand lxc exec --project rhce workstation -- su - student
ssh rhce            # lands on [student@workstation ~]$

Starting and stopping the lab

rht-vmctl stop all       # frees ~7 GiB of RAM
rht-vmctl start all

Moving files in and out

Because the host can't reach the VMs over the network, copy files through LXD instead:

lxc file push notes.txt workstation/home/student/            # host → VM
lxc file pull workstation/home/student/practice/notes.txt .   # VM → host

Every exercise follows the same loop

Each chapter ends with an exercise, and many lessons have a shorter guided one. They all use the same five steps, whichever lab you built:

rht-vmctl reset servers on the host, so every exercise starts from the same state.

lab start NAME on workstation, with the name the exercise page gives. It creates ~/NAME with the brief and any starter files.

Follow the steps on workstation and the servers. Break things on purpose; the reset is a few seconds away. firewalld runs on every server, as on a RHEL server, so a new network service needs its port opened before you can reach it from workstation.

lab grade NAME checks your result on the servers and prints PASS or FAIL for each requirement. It only reads; fix what failed and run it again. For lasting changes, reboot the server and grade once more: a change that does not survive a reboot is not finished.

lab finish NAME on workstation puts the folder away in ~/lab-archive/. Then reset the servers on the host for the next one.