href="#u4ed9eab7-4328-5875-9eb2-f088e81e44d0">Chapter 2 and complete it. This exercise will take you step‐by‐step through the Oracle VirtualBox installation process. When you have finished that exercise, come back to this chapter for the next section.
If you need to take a break, close out the VirtualBox interface window by clicking the X in the upper‐right corner. However, if you want to plow ahead, keep it open. We'll launch into installing CentOS in the next section.
CentOS
Installing the CentOS as a VM may feel overwhelming the first time you do it, and there are a few tricky items to negotiate along the way. We'll help you through this initial instance to build your confidence and help you avoid potential pitfalls.
SETTING UP A CentOS CONFIGURATION WITHIN ORACLE VirtualBox
Prior to installing CentOS as a VM within the VirtualBox hypervisors, you need to perform a few basic tasks to create and configure a place for the new VM within the VirtualBox app. After you have completed these tasks, on your host machine you will have a folder for the new VM as well as two files within the folder—one file for the VM configuration information and one file acting as a hard disk for the VM.
Follow these steps to configure the CentOS VM. There are only a few steps needed to complete this part of the installation project, but they are important! So, don't skim through this exercise.
1 Open the Oracle VirtualBox app on your host system. How this is accomplished depends on the configuration you chose when installing the VirtualBox software. You may have to find it via the menu search feature on Windows 10 or simply click the VirtualBox icon on the desktop or taskbar. Once you have the app open, you should see a window showing the Oracle VirtualBox Manager that looks similar to this (note that you may or may not have an Ubuntu Server VM showing in your Manager window):
2 In the VirtualBox Manager window, using the top menu within the window, select Machine ➢ New. This will start the process of configuring the CentOS VM and produce the following Create Virtual Machine window:
3 Enter the name CentOS Server in the Create Virtual Machine window's Name box.
4 Click the Next button to reach the Memory Size window, which looks similar to the following:
5 By either typing in the memory setting box or using the up‐arrow button, change the CentOS Server memory to 2048 MB.
6 Click the Next button in the Memory Size window to reach the Hard Disk window.
7 Double‐check that the Create A Virtual Hard Disk Now option is selected. (You can tell that a particular option is selected by the circle next to it being filled with a dark color, as shown in the previous figure.) If you need to select Create A Virtual Hard Disk Now, click the empty circle next to the option.
8 Click the Create button in the Hard Disk window, which will open another configuration window called Hard Disk File Type.
9 Within the Hard Disk File Type window, ensure that the VirtualBox Disk Image (VDI) is selected.
10 Click the Next button, and the Storage On Physical Hard Disk window will appear. This configuration window looks similar to the following:
11 Double‐check that the Dynamically Allocated setting is chosen.
12 Click the Next button to open the File Location And Size window. In this window, you will see where the VM's virtual disk file is created as well as its size. This configuration window looks similar to the following:
13 Change the file size to 20 GB by typing 20 within the size box.
14 You are now ready to create the basic configuration and virtual disk file of the VM. Do so by clicking the Create button.You should now be back at the VirtualBox Manager window with the CentOS Server VM in the left pane, as shown here:We have a few more configuration steps to take before the VM is completely configured.
15 Click the Settings button in the VirtualBox Manager's top‐right pane, which opens the Settings window for the CentOS Server VM.
16 In the Settings window, click Network in the left pane to open the Network Settings window for the CentOS Server.The next few steps help you to set up a second network interface card (NIC) on the CentOS Server. This allows your VM to act as an independent node on your network.
17 In the Network Settings window's right pane, click the Adapter 2 tab.
18 In the Adapter 2 tab window, click the empty box next to Enable Network Adapter.
19 Still in the Network Settings’ Adapter 2 tab window, use the arrow to open the drop‐down menu in the Attached To box, and select Bridged Adapter. Except for the Name box, your selections should look similar to the following:
20 Click System in the left pane to open the System Settings window for the CentOS Server.
21 In the Pointing Device selection, click the down arrow and select USB Tablet from the drop‐down menu. This is a critical step that will avoid problems with your mouse working inside and outside of the virtual machine.
22 Click the OK button to save the changes you made to the CentOS VM settings.You should now be back to the VirtualBox Manager window. Pat yourself on the back! You have successfully configured the CentOS Server VM.
Your hard work is about to pay off. You are now ready to install the CentOS distribution on the virtual machine you just configured within VirtualBox.
INSTALLING CentOS AS A VM
After configuring the CentOS VM within the VirtualBox hypervisor, you can perform the actual installation of the Linux OS. Conducting the installation process on a VM is similar to conducting it on a physical server. There are just a few differences, such as loading the ISO image file into the virtualized DVD drive.
Follow these steps to install CentOS as a VM:
1 If not already opened, open the Oracle VirtualBox hypervisor app on your host system.
2 If you have multiple VMs configured in your hypervisor, click one time on the CentOS Server VM to select it.
3 Click the Settings button in the VirtualBox Manager's top‐right pane, which opens the Settings window for the CentOS Server VM.
4 In the Settings window, click Storage in the left pane to open the Storage Settings window for the CentOS Server. It will look similar to the following:
5 In the Storage Settings window's middle pane under Controller: IDE, click the word Empty to open the Attributes pane for the IDE optical drive.
6 In the Storage Settings window's Attributes pane, click the DVD image to produce a drop‐down menu, and select Choose/Create A Virtual Optical Disk. An Optical Disk Selector window will appear that looks similar to the following:
7 In the Optical Disk Selector window, click the Add icon, which will open the Windows Explorer utility, and you will see “Please choose an optical disk file” in the window's title bar.
8 Navigate to the location of your CentOS ISO image file, select the file by clicking it, and then click Open. The Optical Disk Selector window now looks similar to the following:
9 In the Optical Disk Selector window, click Choose, and you're returned to the Storage Settings window's Attributes pane with the CentOS ISO image filename displayed under Controller: IDE.
10 Click OK to keep the virtually loaded ISO image file and return to the main VirtualBox Manager window.
11 Boot your CentOS Server VM by clicking the Start button in the VirtualBox Manager's top‐right pane.You