From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security

Lab setup

- [Instructor] We're going to need more than one guest VM in this course. In part one of this series, we created two virtual machines but installed them using different methods. To keep troubleshooting to a minimum, we will clone rhhost1 VM to create an rhhost2 VM. This is a fairly pain-free process. To ensure that we have enough space, we can delete the CentOS 8-KSVM as we won't need it anymore. If you have extra space and want to keep it, then that's fine too. To delete it, make sure you're a CentOS 8-KSVM is powered down. Then in the virtual machine manager GUI window, right click on it and select delete. Then click on delete again and click on yes. Now let's clone rhhost1. Right click on rhhost1 and select clone, change the name to rhhost2, and then click on clone again. You will also want to have host name resolution for your VMs. This will allow you to refer to host name instead of remembering IP addresses. When we set our rhhost1 VM, we configured the network source mode of rhhost1 to be a bridge. In my case, the network source is host device ENP0S25 macvtap. You'll want to double check that both VMs are configured in this manner. Note that when using the bridge network, our VMs will be able to communicate with each other, as well as any physical hosts on the network, except our KVM host. With KVM there is no host to guest network communication by default. Just keep this in mind when troubleshooting. Once you've double-checked the network source mode on both VMs, boot them up. Once rhhost two has booted up, go ahead and log in. Once logged in, open a terminal. In the terminal type in IP space addr and hit enter. Here I can see that my IP address for rhhost2 is 192.168.2.124. Please take note of your rhhost2 IP address, and then switch over to rhhost one. Then log in as user one and open a terminal. In the terminal type in IP space addr again, and hit enter. I can see that my IP address for rhhost1 is 192.168.2.24. These steps should give you IP addresses that run the same network. If either addresses on the 192.168.122 network, then you may need to go back to the virtual machine manager GUI and double-check the network device settings as that's the IP address for the Nat network. Now that we have two VMs on the same bridge network let's make sure they can communicate. While logged into rhhost1 ping rhhost2. For me, I'd type in ping space dash c1 space 192.168.2.124. Type in your rhhost2 IP address here and hit enter. If successful, they can communicate. Now let's configure static name resolution. Again on rhhost1 type in clear then type in pseudo space vi space slash etc slash hosts and hit enter. Type in your password as prompted. Go into answer mode by pressing the I-key, and then go to the end of the file and append a line. On that line, then type in your rhhost1 IP address. Mine is 192.168.2.24 space rhhost1.localnet.com space rhhost1 and then hit enter. Now type in your rhhost2 IP address. Mine is 192.168.2.124 space rhhost2.localnet.com space rhhost2. This will allow you to access rhhost2 by name. Save and exit by pressing escape colon x exclamation mark and hitting enter. Now let's copy this file to rhhost2. Type in scp space slash etc slash host space, root at rhhost2 colon slash at c slash hosts and hit enter. When prompted type in the root user's password on rhhost2 and hit enter. Since we cloned this VM the rhhost2 root password should be the same as rhhost1. Now both VMs should be able to access each other by host name. One last thing we'll want to do is change the host name of rhhost2. First let's log into rhhost2. Type in ssh space rhhost2 and hit enter, then type in your password on rhhost2. You'll notice our prompt still says rhhost1. Let's change this. Type in pseudo space host name CTL space set dash host name space rhhost2.local net.com and hit enter. And then enter your password. Now let's go ahead and close the terminal and reopen it. Now, if you log out and log back in, you should see the host name change.

Contents