Mounting local drive with guest extensions

In the last entry we created a Linux install by creating a new virtual machine and booting from an iso image. This works but is very time consuming every time we want a playground. In this entry we will clone an existing machines using thin cloning, modify the clone, add guest services extensions, mount the E:\ drive to reading, and stage an installation of the 11g Oracle database.

The first step is to clone our existing machine. We don’t want to create a new one because the first one took almost two hours. If we left click on the oel6u5 example and right click we can select Clone…

Screenshot 2015-07-02 17.36.32

 

We are given the option of a full clone or a linked clone. A full clone takes all of the files that we created (the 40G root disk which is thin provisioned) and makes a new copy of it. The linked clone tracks differences from the old instance and the clone instance. As changes are made to the new instance, they are recorded in a new directory. The old instance is forked and any new changes happen in a new file. The old file preserves a spot in time where the two were the same. Screenshot 2015-07-02 17.36.45

 

The linked clone comes back almost immediately since no files are copied to create the new instance.

Screenshot 2015-07-02 17.36.51

 

What we want to do is mount the E:\ drive as a media folder inside of our guest operating system. To do this we must go to the settings and select shared folders. We Add a shared folder access point and map it to the E:\ drive. We automount it and make it read-write.

Screenshot 2015-07-02 17.36.59 Screenshot 2015-07-02 17.37.10 Screenshot 2015-07-02 17.37.18

 

While we are in the setting we also need to remote the CD/DVD since we are finished installing the operating system and want to boot off our new instance. We do this by selecting Storage, selecting iso file that we mapped, and clicking on the blue icon at the bottom with a minus sign in it. This removes the CD from our mapping and we boot from the hard drive that we used for our installation.

Screenshot 2015-07-02 17.37.51 Screenshot 2015-07-02 17.40.30 Screenshot 2015-07-02 17.40.33

Once we reboot, we log in as the user oracle and add the guest services extensions. This is done by going to the top menu bar in the VirtualBox window and selecting Insert Guest Additions CD image from the Devices menu. This mounts the CD and asks you if you want auto-run the content.

Screenshot 2015-07-02 17.41.00 Screenshot 2015-07-02 17.41.50 Screenshot 2015-07-02 17.42.05 Screenshot 2015-07-02 17.42.15 Screenshot 2015-07-02 17.42.23 Screenshot 2015-07-02 17.43.13

Note that kernel modifications were made to map the local drive to a mounted resource. We can eject the guest services CD and verify that the file system is mounted.

Screenshot 2015-07-02 17.43.27 Screenshot 2015-07-02 17.43.49

It is important to note that the /media/sf_E_DRIVE is readable only by root. We can copy data from this location to a local location as is needed for database installation or just access the data as root.

Screenshot 2015-07-02 17.44.16 Screenshot 2015-07-02 17.45.58

Before we install the 11g database we will want to change the hostname of this machine. We will keep the ip address the same but change the hostname by editing the /etc/hosts and /etc/sysconfig/network files. We will also need to change ownership of the staging directory back to oracle with the chmod -R command to make it owned by oracle for the installation.

Screenshot 2015-07-02 17.49.42 Screenshot 2015-07-02 17.50.13 Screenshot 2015-07-02 17.51.12 Screenshot 2015-07-02 17.52.13

In this example we change the hostname from oel6u5ex to db11g since we are staging to install the 11g instance of the database. We could have changed it to db12c if we were going to stage the 12c instance of the database. The process and procedure is the same with the exception of the hostnames and which database binaries we put into the staging area.

up next: installing the 11g database into our sandbox

Installing OEL6U6

In our previous post we downloaded VirtualBox, downloaded V41362-01.iso, and configured a single core, 4G of RAM, 40G of hard drive system with two network interfaces. We mounted the Oracle Enterprise Linux Release 6 Update 5 as a virtual CD-ROM once it finished downloading from edelivery.oracle.com. We stored on our E:\iso directory on our sandbox system to use again if needed. We created the virtual disk in the E:\VirtualBox VMs directory and are ready to boot the operating system to start the installation process.

To be honest, I reverted back to OEL6U5 because I had trouble getting the OEM6U6 to install and configure properly. I went with something that I know works and the features/differences between update 5 and update 6 are not that significant when it comes to the Oracle database.

To start the installation process we select an iso image by clicking on Storage and selecting the CD/DVD iso that we are going to boot from. In this case we select the V41362-01.iso file from our E:\iso directory and click on the green Start button at the top left.

Screenshot 2015-07-02 16.04.47Screenshot 2015-07-02 16.06.27 Screenshot 2015-07-02 16.04.25  Screenshot 2015-07-02 16.06.44

 

Once we click on start it takes us to the boot menu for the operating system. We select install and follow the menu prompts.

Screenshot 2015-07-02 16.06.58Screenshot 2015-07-02 16.07.26Screenshot 2015-07-02 16.07.31Screenshot 2015-07-02 15.33.28

Screenshot 2015-07-02 16.07.54 Screenshot 2015-07-02 16.07.59 Screenshot 2015-07-02 16.08.03 Screenshot 2015-07-02 16.08.08 Screenshot 2015-07-02 16.08.27

Configure the network so that eth0 has a static ip address of 192.168.1.121, netmask 255.255.255.0, and default router is 192.168.1.254 (this is my Uverse router). The default dns is 8.8.8.8 with the backup being 8.8.4.4.

Screenshot 2015-07-02 16.08.36 Screenshot 2015-07-02 16.08.44 Screenshot 2015-07-02 16.09.17 Screenshot 2015-07-02 16.09.31 Screenshot 2015-07-02 16.09.45 Screenshot 2015-07-02 16.09.55

 

after setting the timezone and root password, choose to overwrite all data on the existing disks and select a software development platform to install. The software development platform is selected to give us a compiler as well as a user interface. If you select the basic server you do not get a user interface.

Screenshot 2015-07-02 16.10.07

Screenshot 2015-07-02 16.10.17 Screenshot 2015-07-02 16.10.24

Screenshot 2015-07-02 16.10.31 Screenshot 2015-07-02 16.10.39 Screenshot 2015-07-02 16.10.47 Screenshot 2015-07-02 16.11.12

Once the system comes back you can reboot and finish the installation.

Screenshot 2015-07-02 16.24.26Screenshot 2015-07-02 16.25.33   Screenshot 2015-07-02 16.26.03Screenshot 2015-07-02 16.25.48Screenshot 2015-07-02 16.25.57Screenshot 2015-07-02 16.25.43Screenshot 2015-07-02 16.26.17Screenshot 2015-07-02 16.26.29Screenshot 2015-07-02 16.26.37     Screenshot 2015-07-02 16.26.46

At this point we have a valid system and can login, alter the /etc/hosts table, alter the /etc/sudoers file, and run yum update to download the latest patches.

Screenshot 2015-07-02 16.40.52 Screenshot 2015-07-02 16.41.05Screenshot 2015-07-02 16.41.28  Screenshot 2015-07-02 16.41.53Screenshot 2015-07-02 16.43.09Screenshot 2015-07-02 16.43.42   Screenshot 2015-07-02 16.46.18

The yum update will probably take as long as the installation process took. Overall this takes about an hour or two depending upon your network connection speed and amount of RAM that you allocate.

Screenshot 2015-07-02 17.32.54

We now have a fresh install of Oracle Enterprise Linux 6 Update 5 with the latest patches. I suggest that you clone this instance and put it on long term storage somewhere. We don’t need to spend an hour or two recreating this again.

up next: Mounting the E: drive inside the virtual machine to stage other software installations.

 

Downloading and setting up installing OEL6

In this entry we will go through downloading and installing Oracle Enterprise Linux Release 6 update 6. We are selecting this version over RedHat or Ubuntu or Debian because most of the Oracle documentation talk about how to install and configure on OEL6. We could do this for OEL7U1 or OEL5U?. We just selected OEL6U6 because it is the most recent with the best examples on the web.

Two things to consider when installing guest operating systems on VirtualBox are iso images and image sizes. To make things easier we consolidated software into two directories. The first is an iso directory. This directory is for operating system installations. The second directory is for the binaries like the database or identity servers. It is easier to isolate the two because one is used to jumpstart a new instance. The second directory can be mounted and pulled into an instance to install software. The second are that we need to consider is the directory to hold the virtual images that VirtualBox creates.

For our sandbox machine, we installed a 2T disk to hold iso images, binaries, and virtual images. In our example, this is drive E.

Screenshot 2015-07-02 14.04.00

We have consumed about 500G of a 2T drive

Screenshot 2015-07-02 14.03.47

There are three directories that we created: iso, oracle, and VirtualBox VMs. What we want to do is download the operating system iso files from edelivery.oracle.com and put it in the iso directory as is shown.

Screenshot 2015-07-02 13.59.21

To keep things a little more organized, we use a naming convention to identify the iso file. Oracle creates a file with a filename like V52218-01. This means nothing to me but OEL6U6 x86_64.iso has relavance. Note the file convention that we use contains both. The V(number).iso tells us the version that was downloaded from the edelivery site and the OEL6U6 tells us that this is the Linux Release 6 Update 6 version of the OS. Note that some of the conventions are reversed. For the OEL7 iso we had the V(number) inside the parenthesis and the OEL7 outside. Either works as long as you can tell which is which easily.

To download the iso file, you need to go to edelivery.oracle.com and select the Oracle/Linux VM from the top of the screen. There are three options in the pull down: Main, Oracle/Linux VM, and Oracle 1-click. The Main and Oracle 1-click allows you to download the installation binaries for things like the database or E-Business suite. The Oracle/Linux VM allows you to download OracleVM, Linux, and Solaris binaries. Unfortunately, the license requirements and conditions are different prior to downloading the software. Oracle requires you to select what you are going to download and agree to user and license restrictions.

goto http://edelivery.oracle.com and select Oracle Linux/VM to get to the operating system download.  Screenshot 2015-07-02 13.56.16Screenshot 2015-07-02 13.56.20

 

 

 

 

 

Login with your oracle.com credentials.

 

Screenshot 2015-07-02 13.56.31Screenshot 2015-07-02 13.56.40

 

Accept the license to search for the OS

Screenshot 2015-07-02 13.56.52

 

 

 

 

 

 

 

 

 

Look for Linux on a 64-bit systemScreenshot 2015-07-02 13.56.59

 

 

 

 

 

 

 

The OS downloads will come back in release order. Re-sort by Updated date to look for the latest version. Screenshot 2015-07-02 13.57.12 Screenshot 2015-07-02 13.57.19

Select the Release 6 Update 6 version and download the iso images. Note that there are three. The largest is the DVD image that we typically want to boot from.

Screenshot 2015-07-02 13.57.36  Screenshot 2015-07-02 13.57.53

The download takes a while. Remember that you are downloading a 4G iso image. There is no need to download the source, only the bootable iso image.

Once the images are downloaded we need to configure VirtualBox to read this image and boot from it. To start this, we click on the New icon at the top left of the VirtualBox console.

Screenshot 2015-07-02 14.34.35 We call this instance OEL6 example, select Linux as the OS and Oracle 64-bit as the version.  Screenshot 2015-07-02 14.34.50

 

 

We change the memory for this instance to 4G. We can get by with much less but if we are using this for a database, 4G is the minimum recommended.

We create a 40G drive as a virtual, dynamically created drive. Note that we could create this as a VMDK file which makes it compatible with VMWare. In our example we use the VDI since is compatible with OracleVM. Either should work.

Screenshot 2015-07-02 14.34.55 Screenshot 2015-07-02 14.34.59 Screenshot 2015-07-02 14.35.03 Screenshot 2015-07-02 14.35.23

 

We now have a virtual container that we can boot an iso image into. We do need to modify the network as well as mount the iso image as a CD-ROM for booting.

Screenshot 2015-07-02 14.36.58

To map the iso image, we click on the storage and map the iso image as a CD-ROM. Click on the Circle on the right with a Plus sign on it. This pops up the add new CD/DVD question and file selector when we click on Choose disk.

Screenshot 2015-07-02 14.43.17 Screenshot 2015-07-02 14.43.22 Screenshot 2015-07-02 14.43.30 Screenshot 2015-07-02 14.43.35

 

Next we configure the network to have a bridged interface on adapter 1 as well as a host only network interface on adapter 2. This should give us an eth0 as a bridged network and eth1 as a host only interface.

Screenshot 2015-07-02 14.43.45 Screenshot 2015-07-02 14.43.54

From here we click on Start at the top left of the VirtualBox console which gets us into installing the operating system.

Up next: Installing OEL6U6