This tutorial explains the initial configurations you need to set up a virtual practice lab on VMware Workstation or VirtualBox to prepare for the RHCSA/RHCE exam.
RHCSA/RHCE is a performance-based exam. To pass this exam, you have to complete given tasks in a given time. Since it is a practical exam, you can't pass it by cramming exam dumps. To prepare for this exam, you have to practice the exam topics in the virtual or physical computer lab.
RHCSA/RHCE practice lab needs at least two computers. If you have two dedicated computers, you can use them to set up a physical lab. If you don't have dedicated computers, you can create two virtual computers on one physical computer and use them to set up a virtual lab.
In this tutorial, we will learn how to set up, configure, and prepare a virtual lab to practice the RHCSA/RHCE exam topics.
For virtualization, you can use either VMware Workstation or VirtualBox. Download one of these and install it on a computer having at least 8GB RAM and 40GB free disk space. Create a virtual computer and install the latest version of RHEL or CentOS on it. Create a new virtual machine by cloning the first virtual computer.
The following tutorial explains the process in detail with step-by-step instructions.
RHCSA/RHCE lab set up on VMWare and VirtualBox
This tutorial explains how to create a virtual computer or clone an existing virtual computer on VMware Workstation or VirtualBox.
RHEL Installation step-by-step explained
This tutorial provides step-by-step instructions to install the latest version of RHEL on a virtual or a physical computer.
The following section assumes that you have two virtual computers with RHEL installation.
Adding virtual computers to the virtual network
In the lab, we will use the first computer to configure various settings and services and the second computer to test them. We can use the second computer for the testing only if it has the proper connectivity with the first computer.
By default, VMware Workstation or Virtual box does not add a virtual computer to a virtual network. Unless two virtual computers are connected to the same virtual network, they will not communicate with each other.
To join two virtual computers in a virtual network, create a virtual network and add the virtual computers to the virtual network.
Creating a virtual network on the VMware workstation
Open VMware Workstation and select a virtual machine from the left pane. On the right pane, click the option 'Network adaptor - LAN segment.'.
In the 'Network connection' section, select the 'LAN segment' option. If you have already created virtual networks, VMware lists them in the drop-down. Use the 'LAN managements' option to create a new virtual network and rename or remove an existing network. Create a new virtual network, select it, and click OK.
Create a new virtual network, select it and click OK.
Select the second virtual computer for the left pane, and click the 'Network adaptor - LAN segment' option in the right pane. In the Network Connections section, select "LAN Segment" and select the virtual network you created on the first virtual computer.
Now, both the virtual computers are members of the same virtual network, named RHCE.
Creating a virtual network on VirtualBox
Select the virtual machine for the left pane and click the Settings option in the right pane. The virtual machine's settings will open in a new window. Select the Network option in the left pane. Select Adapter 1, and click the 'Enable network Adapter' option. Then, click the 'Attached to' drop-down and select the 'Internal Network'.
Enter the name for the new virtual network and click OK.
Repeat the same process on the second virtual computer except for creating a new virtual network. On it, select the virtual network that you created on the first virtual computer.
Now both virtual computers belong to the same virtual network.
Changing or setting the hostname and IP address
When installing RHEL, if you did no configure the default hostname and network settings or used the cloning feature to create the second virtual computer, you need to configure or set the hostname and IP address to complete the lab setup.
Each computer needs a unique hostname and IP address to communicate with other computers on the network. To configure the hostname and IP address, power on the virtual computer, log in with the root account and perform the following steps.
Since these settings are related to RHEL, the process will be the same on both the VMware Workstation and VirtualBox.
Click the Activities icon (available on the top left of the screen), type "settings" in the search box, and click Settings.
Click the Network option in the left pane and click the Settings icon available in the Wired section.
Click IPv4, select Manual method, and set the IP address to 192.168.0.1 and Netmask to 255.255.255.0.
Click the Details tab, click the Connect automatically option, and click the Apply button.
If you do not select this option, you will need to connect the computer to the network each time you reboot the computer.
Click Details in the left pane.
Set the hostname to Server1.
Restart the computer.
Although a restart is not required, it allows us to test and verify that we have configured the hostname and required networking correctly.
Repeat the same process on the second computer and set the hostname to Server2, IP address to 192.168.0.2, and Netmask to 255.255.255.0.
Testing the virtual lab setup
To test and verify the setup, on Server1, log in with the root account and open a terminal.
The hostname command prints the hostname of the computer. The 'ip addr show' command displays configurations of all the active interfaces.
You can use the output of these commands to test and verify your setup.
To test connectivity between both virtual computers, you can use the ping command. By default, the ping command sends infinite numbers of packets in a sequence (one at a time). To break this sequence, press the Ctrl + C keys.
If you get the reply in the output of the ping command, it verifies that both computers have proper connectivity.
Common troubleshooting tips
If you face any problem, you can use the following troubleshooting steps.
- Check the name of the virtual network. Both virtual computers must belong to the same virtual network.
- Make sure, you log in with the root account. You can't change the hostname and networking settings from a regular user account.
- Make sure, you click the “Connect automatically” option available under the Details tab of the Network setting. By default, Linux does not start the networking when you start the computer. If you do not select this option, the networking will not start.
- Before testing connectivity, make sure both the virtual computers are powered-on.
Watch the Video Version of this Tutorial
That's all for this tutorial. In this tutorial, we learned how to set up and configure a virtual lab to practice RHCSA/RHCE exam topics.