From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

CentOS 7 lab setup - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

CentOS 7 lab setup

- [Instructor] For the best experience, you'll want to install VirtualBox Guest Additions in your Centos 7 VM. This will allow you to do fullscreen mode and have a seamless mouse experience. First, make sure your network is turned on by going to your top right menu in rhhost1 VM. Click on Wired Off, and then click on Wired Settings. Then click the slider button next to your wired connection. This activates the network connection, but does not make it persistent. To make it persistent, click on the gear icon next to the slider button. Now click on Connect automatically and click on Apply. Now you can close this window. Now let's update all software packages by opening a terminal and then typing in sudo yum update -y and hit Enter. And then enter your password if prompted. This should've updated all packages, including kernels. Now reboot by typing in sudo reboot and hit Enter. Do not skip this step, or installation of the Guest Additions will likely fail. After your VM reboots, log in. Once logged in, open a terminal and type in sudo yum group install -y "Development tools, with a capital D, double quote, and hit Enter. And enter your password if prompted. This installs the software development tools. After they're done, we'll install the kernel headers. Now let's install the kernel headers. Type in clear, then type in sudo yum install -y kernel-devel and hit Enter. Once that's done, you can close the terminal window. Next, insert the Virtual Guest Addition CD, using the VirtualBox devices menu. You may have to press your host key to release your mouse pointer. Select the devices menu and then select Insert Guest Additions CD image. VirtualBox will probably have to download the Guest Additions ISO image. It may also fail, it often does. Click on Download, and then click on Download again. If it fails, click on Cancel All, click on OK, and then go back up to your Devices menu. Click on Insert Guest Additions CD image again, and then click on Download again, and this time, click on the link. This will open Firefox, and Firefox will download the ISO image. Click on save file, then click on OK. Choose your location, and then click on Save. Once that's done, close Firefox. Go back to your virtual machine and cancel the download. Now go back to your drive menu. Click on Optical Drives, and then click on Choose disk image, and then choose your disk image. Click on VBoxGuestAdditions, then click on Open. When the dialogue box appears, click on Run. And enter your password. This process will take a few minutes, as it has to compile a kernel module. It may even look like it failed, but be patient, and wait until you get your prompt back. Now you should have fullscreen mode, faster networking, better graphics modes, seamless mouse mode, and copy and paste between the host and VM. You can close this window now. Shut down the VM by going to the top right-hand menu, and clicking on the power button, and then clicking on Power Off. Now let's configure the network. Make sure the VM is selected and then click on settings. Then click on Network. We're going to change the Attached to NAT to Attached to Bridged Adapter. Make sure you choose your physical network adapter on your host. Mine is enp0s25. Now, let's add some additional drives for our storage exercises later. Click on Storage in the left-hand pane. Now click on Controller SATA, and then right-click and select Add Hard Disk. Click on create a new disk, then click on next. Click on Next again, and for the size, let's change it to one gigabyte. For our exercises we need a lot of drives, but we don't need them to be very large. Also note the name. This one is NewVirtualDisk1.vdi. Click on Create. Now create three more drives the same way, incrementing the name for each one. When you're done, you should have five drives total, the operating system drive, and four additional drives that we just added. Now click on OK. Now let's make a clone of this VM. Later in this course, we'll talk about different ways of deploying VMs. This method takes a golden image and makes a clone of it, and is a valid way of creating a new VM. Right-click on the VM and then select Clone. Change the name of the clone to rhhost2. Click on Linked Clone, to save space. And then for MAC Address Policy, change it to Generate new MAC addresses for all network adapters. And then select Keep Disk Names. Now click on Clone. When it's done, boot each VM to ensure everything works. You may also want to change the hostnames, so you can tell the VMs apart. The very last thing we'll do is snapshot the VMs. We can snapshot any state by pressing the host key, which on my OS is the right Control key plus the T key. I'll name my snapshot Base Install, and then click on OK. You'll want to do this with both of your VMs. Now whenever you want to revert back to this fresh state, you can just close the VM, and select Power off the machine, and click Restore current snapshot 'Base Install', and then click OK. This allows you to practice the course exercises more than once. And now we have our CentOS 7 lab set up, and we can proceed.

Contents