ISIDM001: Creating a base Virtual Machine

ISIDM001: Creating a base Virtual Machine 1 Table of Contents Installing Virtual Box ................................................
Author: Anis Andrews
4 downloads 1 Views 1MB Size


ISIDM001: Creating a base Virtual Machine





1



Table of Contents

Installing Virtual Box .............................................................................................................. 3 Creating a new VM ................................................................................................................. 6 Installing Oracle Enterprise Linux as Base OS .......................................................................... 9 Ensuring networking connectivity to VM ............................................................................... 14 Installing VM Guest Additions ............................................................................................... 17 Configuring hosts file ............................................................................................................. 19 Setting up shared folders ....................................................................................................... 20 Installing JAVA on VM ........................................................................................................... 23 Setting Environment variables ............................................................................................... 24 Snapshot of VM (Clone option) .............................................................................................. 25 Cloning ........................................................................................................................................... 25







2



Installing Virtual Box Please adhere to the below steps to install Oracle Virtual box software on windows PC/Laptop 1. Double click on the VirtualBox-5.0.14-105127-Win file to start installation. 2. Click NEXT in the first screen. 3. Choosing the default configuration, click NEXT.

4. 5. 6. 7. 8.



Ensure all options are ticked. Click NEXT Click YES Click INSTALL If asked for permissions by Windows, please provide YES as your response.

3



9. Click INSTALL

10. Click FINISH 11. You should see that the Oracle Virtual Box is now ready and started.



4











5



Creating a new VM 1. Click on NEW button in the Oracle Virtual Box. 2. PROVIDE the following details in the new screen

3. Click on NEXT 4. Provide a RAM share based on your current machine’s total RAM available a. It is recommended to provide 8GB of RAM as a minimum. Else provide at least 4GB == 4096 5. Click NEXT 6. Choose CREATE A VIRTUAL HARD DISK NOW option 7. Click on CREATE 8. For the HARD DISK types, leave the settings unchanged and click NEXT (else use VDI option)



6



9. Choose default option as shown below and click NEXT. If you have too much space available in your PC/Laptop change the option to FIXED SIZE.



7



10. Provide 50 GB as the hard disk space. 11. Click CREATE





8



Installing Oracle Enterprise Linux as Base OS 1. Open Oracle Virtual Box software. 2. Click on the newly created VM. (Single Click) 3. Click on the Optical Drive under the STORAGE section for IDE Secondary Master.

4. Choose the CHOOSE DISK IMAGE option. 5. Navigate to the folder where you have downloaded the Oracle Enterprise Linux. 6. Select the first ISO Image.



9



7. 8. 9. 10. 11. 12. 13. 14.



Click OPEN. Click on Settings in the top menu, with the current VM selected. Navigate to NETWORK tab. For Adapter 1, tick ENABLE NETWORK ADAPTER. Click OK. Click on START in the OVM menu. The Virtual machine boots up. Click in the VM window.

10



15. Using arrow keys select INSTALL LINUX. 16. Hit ENTER. 17. Select ENGLISH as the language option a. Select ENGLISH – US as the secondary option 18. Click CONTINUE. 19. Edit NETWORK Settings. a. Provide all necessary configuration settings b. Network: enable ETHx c. Hostname: OIM.ENHCORP.COM d. Check if you can see your local IP now populated in the screen e. Click on DONE



11

20. Change DATE & TIME settings based on your location a. Hit DONE 21. Edit SECURITY POLICY a. Choose DEFAULT b. Click on SELECT PROFILE c. Hit DONE 22. Edit the Software Selection a. Select SERVER WITH GUI b. Under options select the following i. JAVA PLATFORM ii. KDE iii. MYSQL DB SERVER iv. VIRTUALIZATION TOOLS c. Hit DONE 23. Modify Installation Destination a. Choose ATA VBOX HARD DISK b. Click on Select. c. Hit Done 24. Hit begin. 25. Provide Oracle123 as password for ROOT 26. Also create another user a. Full Name: Oracle User b. Username: oracle c. Password: Oracle123 d. Select “Make this user administrator” 27. Click on DONE 28. Installation begins: wait J





12

29. Hit REBOOT in the VM 30. From the menu in boot options, always select the first Oracle Linux as the option. 31. After Reboot, open License Agreement a. Click on ACCEPT b. Click on DONE 32. Click on FINISH CONFIGURATION 33. You may now login. a. Use either root or oracle account. Preferred is ORACLE account. 34. Shutdown the VM.





13



Ensuring networking connectivity to VM 1. 2. 3. 4. 5. 6. 7. 8. 9.

In your windows environment, from Control Panel, go to network settings. Open network adapters. Open the properties for the Virtualbox-Host only network. Ensure the settings are right for IPV4. a. Ensure that the network settings are according to your home router only. Open Oracle Virtual Box software. Select the OEL VM. Click on START. Login as Oracle. At the top right corner in the VM, click on the arrow as shown below.

10. Under PCI Ethernet, click on Wired Settings. 11. Turn the adapter ON.



14



12. Click on the SETTINGS icon. 13. Navigate to Identity tab.



15



14. 15. 16. 17. 18.

Check the CONNECT AUTOMATICALLY check box. Click on APPLY. Under Applications menu, to the left, click and open the Firefox browser. Enter www.oracle.com or www.google.com You should be able to access the internet now. You should also be able to see a ETHERNET port type ICON on the top right corner menu bar in the VM. 19. DO NOT SHUT DOWN THE VM. Continue to NEXT CHAPTER.





16



Installing VM Guest Additions 1. From the VM menu of the current VM, under DEVICES, choose INSERT GUEST ADDITIONS CD IMAGE.

2. Choose RUN for the warning provided. 3. Provide the password for root/oracle. 4. A terminal window opens up. The VBox additions shall be installed. If you have any errors, please follow the below steps. 5. Open a new terminal window from the APPLICATIONS menu. 6. Type the following command and hit enter.

sudo yum install gcc



7. Provide the ROOT user credentials to proceed. This shall install the GCC compiler. 8. For any prompts for downloads, please provide “y” as the response. a. Enter “y” b. Hit enter. 9. Once the gcc installation is done, hit the following command in the terminal.

sudo yum install kernel-devel-3.10.0-327.el7.x84_64 10. Provide the ROOT user credentials to proceed. This shall install the kernel definitions.

17

11. For any prompts for downloads, please provide “y” as the response. a. Enter “y” b. Hit enter. 12. Minimize the terminal window once the installation is over. 13. Open the VBOXAddtions CD on the desktop. 14. At the top right corner of the folder, click on RUN SOFTWARE. 15. A terminal window opens up. The VBox additions shall be installed. 16. After successful installation, restart the system. After restart, you should observe that the screen size is reset to a better resolution, your mouse pointer is now properly integrated into the environment. 17. Right click on the VBoxAdditions CD on the desktop and choose Eject. 18. Shut down the VM.



18



Configuring hosts file 1. 2. 3. 4.

Boot the OEL VM from the Oracle Virtual Box software. Login as oracle. Open a terminal window. Enter the following command.

ping $HOSTNAME



5. You should see an error as UNKNOWN HOSTNAME: OIM.ENHCORP.COM 6. Type the following command in your terminal window.

ifconfig



7. Copy the IP Address for the ETHERNET adapter. (enp0s3) 8. Hit the following command. (hope you know how to use VI editor)

sudo vi /etc/hosts

9. Provide the password for root. 10. Just like the lines in the file, make one more entry. Use the IP address copied in step 7.

10.0.2.15 localhost OIM.ENHCORP.COM



11. Now repeat the below command. You should see success.

ping $HOSTNAME



12. TIP: if you cant figure out the IP etc, then you may use 127.0.0.1 as the IP 13. Shut down the VM.





19



Setting up shared folders 1. Click on the OEL VM in the Oracle Virtual box software. 2. Click on Settings. 3. Navigate to the SHARED FOLDERS tab.

4. Click on the + icon to the right to add a new shared folder.



20



5. For FOLDER PATH Navigate to the folder where you have download and unzipped all the necessary software. 6. Click on AUTO-MOUNT.



21



7. 8. 9. 10. 11. 12. 13.



Click on OK. Click on OK. Start the VM. Click on user on listed in the logon screen. Login as ROOT. You should see the SHARED folder on the DESKTOP. Logout as ROOT.



22



Installing JAVA on VM 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16.



Login to the VM as Oracle. Open the browser. Navigate to WWW.ORACLE.COM Under DOWNLOADS à POPULAR DOWNLAODS à select JAVA for Developers. Select the first icon: JAVA PLATFORM (JDK) 8u73/8u74 In the next page, opt for ACCEPT LICENSE AGREEMENT. Click on … a. Linux x64: jdk-8u73-linux-x64.rpm Choose OPEN WITH: SOFTWARE INSTALL Wait for the download to complete. The installer opens. Click on INSTALL. Provide the password for Oracle user. Once the installation is complete, you will see the INSTALL button replaced with REMOVE. Close the installer. In a terminal window, navigate to /usr/java You should see the latest JDK installed.



23



Setting Environment variables This is very important for smooth flow of all the exercises. It is also important to set these in every environment you use for deployments. 1. Boot and login to the VM if not already there. 2. Open a terminal window. 3. Hit the following commands

cd /home/oracle vi .bash_profile 4. in the editor find the space between PATH & EXPORT PATH commands. 5. Make the following entries in that space. a. PATH=$PATH:/usr/java/jdk1.8.0_73/bin b. PATH=$PATH:/usr/java/jdk1.8.0_73/jre/bin 6. After export PATH, make the following entries. a. export JAVA_HOME=/usr/java/jdk1.8.0_73 b. export JRE_HOME=/usr/java/jdk1.8.0_73/jre 7. Save the file. 8. Reboot the VM. 9. Login as Oracle and ensure that Oracle is able to login. 10. Shut down the VM.







24



Snapshot of VM (Clone option) 1. Choose the VM in the Oracle Virtual Box software. 2. Click on SNAPSHOT button to the top RIGHT corner in the Virtual Box software, while the new VM is selected.

3. Create a Snapshot with name as OEL+JAVA installed 4. Save & EXIT.

Cloning To clone the VM do the following things. 1. Choose the VM in the Oracle Virtual Box software. 2. From the MACHINES menu, choose CLONE.



25



3. Give a new name. a. OEL+JAVA_GoldenVM



26



4. Click NEXT. 5. Choose FULL CLONE.



27



6. Click on CLONE. 7. This will save a new VM in the filesystem. Save the VM as a golden template.



28