Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Contents
Contents .................................................................................................................................... 2 Creating an OEL VM under VirtualBox ....................................................................................... 3 Prerequisites .......................................................................................................................... 3 Create the Virtual Disks ............................................................................................................. 4 Create the Virtual Machine ......................................................................................................... 6 Install OEL ................................................................................................................................. 9 Post-Installation Tasks ..............................................................................................................18 Set-up Network Connections .................................................................................................18 Add User to sudoers File .......................................................................................................20 Set-up the Internal Yum Server .............................................................................................20 Correcting the Video Resolution ............................................................................................21 Updating the Packages .........................................................................................................22 Optional Tasks ..........................................................................................................................23 Expanding the Partition Size ..................................................................................................23 Creating a New Disk and Partitions for ASM..........................................................................24 Installing VirtualBox Guest Additions .....................................................................................26 Installing Oracle 11gR2 Database and Grid Infrastructure .....................................................26 Additional References ...............................................................................................................27
You will have to go through the first 4 sections and then depending on what you are trying to do, you may want to execute some of the optional tasks. Finally, please note that version 3.2.8 is the version of VirtualBox that was used to create this tutorial, so there might be some differences depending on which version you use.
Prerequisites
You must already have installed VirtualBox. VirtualBox is located here: http://www.oracle.com/us/technologies/virtualization/oraclevm/061976.html You must download Oracle Enterprise Linux. I recommend getting the DVD ISO download so you dont have to manage multiple files. This can be found here: http://edelivery.oracle.com/linux You should also download a GParted Live ISO or another partition editor to manage your partitions if you plan to expand them at all. GParted can be found here: http://gparted.sourceforge.net
3. Click New to bring up the Create New Virtual Disk wizard. Select dynamic disk on the first screen. On the second screen, enter the name of the your VM and append _root at the end (e.g.: OEL_root.vdi). You can set the disk to a large size since it will grow dynamically and you can add partitions at a later point. I would set it to a high number like 200GB. It doesnt take up much space and it gives you flexibility if you want to expand the partition later on.
4. Repeat the previous step but for this disk, you can create a fixed sized disk. Create a disk named OEL_swap. This should be sized at 2X your intended RAM. The max RAM on a 32-bit VM is 1.5GB so I recommend just creating a 3GB disk. Since this is a fixed size disk, the initial file might take a while to create as a 2GB file is created. 5. We are finished with the Media Manager
3. On the next screen, you will set your memory requirements. I set mine at 1500MB since I wanted to use it to install the DB and Grid Infrastructure, which requires 1024MB and 1500MB, respectively
4. At the Virtual Hard Disk step, uncheck Boot Hard Disk and dont select a hard disk. You will attach the disk later. You will be warned that you didnt attach a hard disk. Ignore this by clicking Continue and click Finish on the next screen to complete the wizard.
5. Select the machine you just created and click on Settings 6. Click on Storage
7. Click on the SATA Controller, then Click Add Hard Disk icon (the one on the right with the plus sign). If you have any other virtual disks that you are managing, they will show up first so click the Add Hard Disk button until your root and swap disks are added. Once they are added, remove the other disks.
VirtualBox: Creating a Base OEL Image 8. Click on the root disk and Select SATA port 0 for the Slot drop down. Click on the swap disk and select SATA port 1 for the swap disk. 9. Now you want to add the ISO of the OEL install DVD that you hopefully downloaded already. If you havent done that already, you can come back to this screen after its downloaded. 10. Click on the Empty text under the IDE controller in the Storage Tree. In the Attributes section, click on the folder icon to the right of th CD/DVD device dropdown box to open the Virtual Media Manager. From there you will be able to browse your file system to locate your ISO. Click on the Add button in the media manager and select the ISO for the Oracle Enterprise Linux. This will add the ISO to the list of available media. Click on the ISO you just added for Oracle Enterprise Linux and click the Select button.
11. At this point, you should have your ISO in the CD-ROM drive and your 2 disks attached to the SATA Controller. Click OK to finish the updates and get back to the main screen.
Install OEL
1. Select the new virtual machine called OEL Base Image and click on the Start button. 2. Once the OEL title screen appears. Press Enter.
3. Click on the Skip test button, or press the right arrow key to highlight Skip and press Enter. You might see a popup message about mouse integration.
4. On the OEL splash screen, press Next. You might see a popup message about 24 vs 32 bit color modes, this is ok as we are in the installer.
VirtualBox: Creating a Base OEL Image 5. Select the appropriate language and press Next.
7. You will be warned that sda is unreadable and ask if it can format and erase all of the data. Press Yes (since your new virtual disk has no data).
8. You will be warned that sdb is unreadable and ask if it can format and erase all of the data. Press Yes. 10
VirtualBox: Creating a Base OEL Image 9. On the partition screen, select Create custom layout from the dropdown and press Next.
10. Click on the New button. Set the mount point to /. Uncheck all Allowable Drives except sda. Set the size to what you think you will need, we chose 16384MB. Press OK. We are meant to use a small percentage of the virtual disk for the partition. The idea is if we need to a larger disk, we can use a partition program to extend it.
11. Click on the New button. Set the File System type to swap. Uncheck sda so sdb is the only drive checked. Set the size to fill to maximum allowable size since we want to use all of it for swap. Press OK.
11
12. Press the Next button. 13. You will be prompted to ask if you want to install Grub. Press Next to select the default option of installing Grub on /dev/sda
14. Press Next to use the active device of eth0 and DHCP.
15. Select the appropriate country and press Next. WARNING: If you plan to run a mix of a Linux VM (as we are in this case) and Windows host machine, make sure you uncheck System Clock uses UTC. Press Next. 12
16. Enter the root password and press Next. Make sure you record this somewhere.
17. You will be prompted to select the software. The system will default to Gnome Desktop. Select the option Customize Later and press Next.
18. The installer will check for dependencies and then display a screen telling you to press Next to continue the installation. Press Next.
13
19. Installation will continue for about half an hour depending on the speed of your environment, and then you are presented with an option to reboot. Click on the reboot button and boot from the hard drive instead of the CD.
20. After reboot, your configuration will continue on a welcome screen. Press Forward.
14
23. Set the SELinux setting to Disabled (Some Oracle Database issues are caused by having this enabled). Click Yes if you get a popup message about rebooting the system after the first boot is complete. Press Forward to accept.
24. Press Forward to accept the default setting on the Kdump screen.
15
25. If necessary, change the date and time and press Forward to accept.
26. Enter the info for a user other than root. Since youll probably create an oracle user for an install, you should create that here.
16
29. The system will now reboot. When it comes back up, login with the user you created above.
17
Post-Installation Tasks
Set-up Network Connections
To set up the network proxy for external access while on the Oracle network, go to System->Preferences->Network Proxy and enter www-proxy.us.oracle.com with port 80 in the HTTP proxy line.
To access the Internet when not on the Oracle network a. Make sure the VM image is using a NAT connection on the network interface b. Go to System->Preferences->Network Proxy and click on the Direct Internet Connection option. c. Go to System->Administration->Network. When there, click on the DNS tab and clear out the Primary DNS, Secondary DNS, Tertiary DNS, and DNS Search Path. After this is done, you may need to deactivate and then activate the network interface
To access the Oracle network when connecting remotely, you will have to set up a VPN network from your guest VM image. a. You will not be able to access the Internet if you connect via VPN with your host OS. Security policies disable this functionality.
18
VirtualBox: Creating a Base OEL Image b. To set up VPN on your OEL VM, go to http://myaccess.oraclevpn.com and login with your VPN username/password (Note: I had some problems doing this while on the Oracle network so you may want to try when not on the network).
c. Your probably wont be able to install the VPN client through the initial link so you will be presented with a link to Linux i386. That link seems to hang as well so if you right click on that link and choose Save Link As so you can save the script.
19
d. After the script is downloaded, log in as root (su root) and then run the script from where it was downloaded (sh ./vpnsetup.sh). Once you get the VPN client installed, you will be able to access the network through the VPN client.
4. Install the downloaded package by running sudo rpm Uvh FILENAME from the directory where it was downloaded
20
3. Edit the X11 config file through sudo vi /etc/X11/xorg.conf. In that file, you will need to update the resolution by changing the Modes value to 1280x800.
4. You probably want to restart at this point to get the updated resolution.
21
2. You can then select the kernel package if you want the latest kernel update. On the next screen, check Select all packages to install the updates for all packages listed.
22
Optional Tasks
Expanding the Partition Size
1. If you have followed my instructions, we have created a really large virtual disk, but we really only use a small percentage of the disk. To expand a partition size, you have to use a tool like GParted. 2. Download the GParted ISO from http://gparted.sourceforge.net/download.php 3. Once you have the file and have shut down your VM, set the GParted ISO as mounted on your CD/DVD drive by clicking on settings in the main screen and going to the Storage Tab.
4. Restart your VM and if the boot sequence is set up correctly, you will be booted to the GParted UI. Select all the defaults during boot up until you get to the following screen.
5. Click on the partition that you want to resize and then click on the Resize/Move button.
23
6. Once you have set the new size, click on the Apply button. After this is done, click on Exit to exit GParted and reboot your virtual image.
24
3. Go back to the main screen and click on Settings and then Storage. Add the new ASM disk that you created and put it on SATA port 2.
4. You could use GParted for this but if you set up the disk already, you can do this through the terminal. Open a terminal window and switch to root (su root). Run fdisk /dev/sdc or whatever the new device is. Go through the following commands for each ASM disk (I did this 4 times with each disk at 2GB)
5. After creating all the partitions use the w command to write the new partitions to disk.
25
26
Additional References
I used some of the following sites to get a lot of my information that I pieced together in this HOWTO: Linux Partition HOWTO - http://www.faqs.org/docs/Linux-mini/Partition.html Setup Oracle 11gR2 on a centOS 5.4 - http://planetvm.net/blog/?p=1353 Oracle Enterprise Linux 5 Installation - http://www.oraclebase.com/articles/linux/OracleEnterpriseLinux5Installation.php Creating a CentOS virtual machine under Virtualbox http://paulsiu.wordpress.com/2008/09/08/creating-and-managing-centos-virtualmachine-under-virtualbox/
27