Building a 64-bit CentOS 7 Workstation using Oracle Virtual Box jthomas Enterprises, 2016
Building a CentOS 7 Workstation using Oracle VirtualBox 1
Section 1 Before You Begin This section details the environment used in this guide and covers a few preliminary steps that needs to be completed before you can start to build your CentOS 7 64-bit workstation using Oracle s Virtual Box software. It is important that you complete all of these steps prior to beginning. comply with ALL licenses requirements indicated by the source of the software or file. jthomas does not pass through any licensing to you as a user of this guide. Software Used in this Guide Oracle Virtual Box version 5.0.26 Available for download from: https://www.virtualbox.org/wiki/downloads Environment This install guide shows the steps needed to successfully create a CentOS 7 64-bit workstation running in Oracle Virtual Box on a Mac OS X platform. The screen shots and desktop images are that of a Mac OS X 10.11.6 (El Capitan) laptop. In truth, the only Mac-specific items are the locations of the downloads and the fact that the installation of Virtual Box was performed according the Mac OS X instructions given in the PDF install guide, Installing Virtual Box on Mac OS X (which is also available on the jthomas Enterprises website. Note: This guide uses the OS X hosts version CentOS 7 Available as an ISO image for download from https://www.centos.org/download/ Important Note: Anytime you are instructed to download software or files from any Internet site, you are expected to read, agree to, and 2
Note: This guides uses the Everything ISO. The ISO image format is required so that we can use it as an install disk with Virtual Box. Prerequisites 1. Macintosh PC/Laptop with at least 4GB of RAM, 25 GB of available disk space, and running OS X 10.11.6 or newer. 2. Virtual Box should already be installed on your system prior to starting this guide. The installation of Virtual Box on Mac OS X is detailed, step-by-step in the book, Installing Virtual Box on Mac OS X, which can be downloaded from the jthomas Enterprises website here: http://www.jthomas-enterprises.com/blog/index.php?page s/installation-guides After installation, Oracle Virtual Box should be in your Applications folder. find it. For this guide, we downloaded the Everything ISO to the Downloads folder of the MAC OS X user: Note: This download is about 7.77 GB and can take a while. Once the CentOS 7 download is complete, it will look like this in the Finder: 2. Your CentOS 7 ISO image should have been downloaded and placed into a folder on your system where you can easily 3
Section 2 Building the Virtual Machine Start Virtual Box from the Applications folder. It should look like this: Note: of course you can work your way through any inconsistencies in what you actually see and what is printed in this guide and the versions of both Virtual Box and CentOS7 may be newer than those used here. 1. Click New 2. On the resulting popup window, enter the following information and select Other Linux (64-bit) from the pull-down list: The following steps will take you through everything you need to click, select or type to begin the installation of the CentOS 7 virtual machine. Please read each step carefully and, if a screen looks a bit different form what you are experiencing, check the versions of the software you are using. 3. Click Continue 4
4. Set the Memory size to be 2048. You can set it as low as 512 MB but since you will probably want the machine to perform more than just basic desktop applications use a more realistic RAM setting (it can always be adjusted later). 7. When the Hard disk file type pops up, choose the VDI option for the hard disk and click Continue: 5. Click Continue 6. On the Hard disk page, select the option to Create a virtual hard disk now and click the Create button: 8. On the Storage on physical hard disk page, choose the options for Fixed size and click Continue: 5
9. The File location and size shows that 8.00 GB will be allocated by default to this virtual machine. Change the value to 20.00 GB by either typing it in or moving the slider until you get to 20.00 GB. You can leave the name of the disk as is. Click Create when done. 11. When the virtual disk creation is complete, you will be returned to the VM Virtual Box Manager and you will be the machine you just prepared listed in the left-hand side column: NOTE: 20GB will give you some added space if you plan to install additional software later (such as an Oracle database) 10. A status bar will appear as Virtual Box allocates the space for your disk. This can take several minutes. 6
Section 3 Installing CentOS 7 Now that we have Virtual Machine we can start the installation of CentOS 7 from the ISO image we downloaded earlier. This is basically the same as installing a disk into a PC and trying to install a new operating system. 1. From the VM Virtual Box Manager, select the Start option (the green arrow): This is basically booting the virtual machine. 2. A popup window will display asking which device you want to boot this machine from. We need to choose the ISO image of CentOS 7 we downloaded. Browse and navigate to folder where you put the ISO image (ours was in the Downloads folder) and choose the ISO image file: 3. The virtual machine will now start to boot off of the ISO image for CentOS 7. A boot menu will appear as shown below. Make sure to select the Install CentOS 7 option by clicking the mouse inside the window and using the arrow keys to select the correct option: 7
4. As the machine boots, the screen will show various components starting: 6. The next screen will allow you to customize the installation to some degree. The first item to check is the Network and Hostname: 7.Click this button and you can set the network to use any adapter that you see in this list. By default, Virtual box is setup to have this machine share the network adapter of your Macintosh host machine. This is probably a good idea since you will need Internet connectivity to download patches later on. Click the slider next to a connection to enable it: 5. After a short wait, you will be presented the first of several installation screens for the operating system. The first one chooses a language. Select the correct one for your system and click Continue: Now click Done in the upper left-hand corner to complete this part of the setup: 8
8. The next item to customize is the Software Selection: 10. Click Done when the software has been selected 11. Click the button for the Installation Destination: 9. Click this button and choose the following software from the lists provided: h. Gnome Desktop (left side) NOTE: You screen may show a warning icon on this button. It just means that you have not checked this setting yet. i. Office Suite and Productivity (right side) 12. On the page for the destination, verify the disk is 20 GB and make sure the selection for Automatically configure partitioning is chosen: NOTE: We are choosing a very lightweight-basic set of software. More can be added later. 9
13. Click Done when complete. 14. The Begin Installation button in the lower right-hand corner will now be blue. Go ahead and click it: 18. Click on the User Creation option and create a user called developer. We used a password of admin1 for this account and also made the user an Administrator: 15. The next page will show a status bar as the installation progresses. it will also provide you a chance to set the root password for the workstation and create a user account. You need to do both. 16. Click the Root Password option 17. Set the password to whatever you like. We used a password of admin1 (which is very weak but ok for this demo): NOTE: You can create any user account name you like but you should make them an Administrator so you can manage the workstation without always being root. 19. Click Done when complete. 20. The status page will now change to look like this: 17. Click Done when the root password is set. 10
press 1 to read the agreement, 2 to accept the agreement, and the c to continue: 21. Now you just have to wait for the installation to complete. NOTE: This can take a long time if your system has a slow disk or it is busy doing other things. For this guide it took about 45 minutes. 22. When installation of CentOS 7 is complete, a blue Reboot button will appear in the lower right-hand portion of the screen: 23. Click Reboot and the let system completely boot up. As it boots, you will have to accept the license agreement. This will display in the text window and you will have to 11
Section 4 Completing the Installation After CentOS 7 is installed and boots for the first time, you will see a screen like this: At the first sign-in, you need to confirm the language you want and click Next: The developer account we created during the install will be shown as the default account. Click the grey box and enter the password and then click the blue Sign In button (we used admin1 - yours may be different): You can use the Skip button to ignore the next screen that asks to setup any online-based accounts (such as Google) that you might have. 12
The initial sign-in is complete: Adding the Developer Tools Since we did a very basic installation, some of the tools, compliers, and libraries needed to complete the installation are missing. The following steps will instruct you how to add these components. Click the Start using CentOS Linux button and you will be sent to the desktop as shown here: First we need to add the GCC tools which include certain compilers and such. Open a Terminal window by using the Applications menu in the CentOS desktop, and then choosing the Terminal from the Favorites menu: When the terminal window opens, type the following command at the prompt: sudo yum group install Development Tools 13
Enter your password when prompted. The install will start and will download and configure the required tools, libraries, etc. If prompted, always answer yes or y : Installing the Guest Additions The next major step to make this new workstation function smoothly is to instal the Virtual Box Guest Additions. These allow for seamless mouse interaction of the CentOS 7 desktop and your Macintosh, clipboard and folder sharing with the host, resizing of the windows and more. Start the installation by select the Devices menu from the Apple Menu Bar at the top of the screen and choosing the Install Guest Additions CD image from the list: NOTE: When the tools installation is complete, the terminal window may close. If it does, reopen it again. Now enter another command at the prompt as shown here (all on one line): sudo yum group install kernel-devel-3.10.0-327.e17.x86_64 This will start another required install. Enter your password and answer yes or y to any further prompts: A confirmation box will display asking you to confirm that you want to run the Guest Additions Software. Click Run. 14
You will need to enter your password ( admin1 in our case) and click Authenticate. Confirm that you want to Restart the machine: A terminal window will display showing you the progress. When it completes it will ask you to hit Return to close the window. Rebooting the Virtual Machine Let the Virtual Machine completely reboot before proceeding. To complete the Guest Additions installation, you must restart the CentOS VM. At the top of the VM s window, there is an arrow icon on the far right-hand side. Click the arrow and select the option to restart the VM (the power button). 15
Section 5 Final Steps After the VM reboots, log back in as developer. The Guest Additions CD may be displayed on the desktop. You can remove this by right-clicking and selecting eject. Network Connectivity Since you are sharing your network connection with the host Macintosh, you should be able to browse the web. Click the Applications menu and loom for the Firefox web browser. Start the browser and it should start and www.centos.org With the Guest Additions installed, you should be able to resize the VM s window and the desktop should stretch to fill the space. You can also enable cut and paste between the host Macintosh and the CentOS VM by choosing the Devices menu from the Apple Virtual Box menu, and the choosing the Shared Clipboard submenu and setting the option to Bidirectional. Installed Tools Inside the VM, you will find that the LibreOffice tools have been installed. Click the Applications menu and then the Office submenu: Software Updates Now is a good time to download and update any software on the workstation. Go to the Applications menu, and then choose the Application Installer from the Favorites. When it opens up, chose the Updates button at the top and aftre a few seconds, a list of updates should be displayed: 16
Once the system restarts, your installation is complete. Start using your new Virtual CentOS 7 workstation! Click the Restart and Install button at the top right, confirm your selection and begin the update process As the updates are installing, the screen will look like this: 17