I have a confession to make. I have not been into Linux very much. When I started my career at Oracle, back in 1994, I had to do a little bit of development work on a UNIX machine. That’s where I acquired from cd, vi, sed, grep and ls skills. But in later years, on my own laptop, I took the easy way out and succumbed to Windows and GUIs. Then I started using Virtual Machines and even they had Windows as their client operating system most of the times. I have occasionally downloaded Linux based VMs from OTN – and used as the server side in my development efforts quite happily – and I was supplied with such Linux VMs by several very helpful colleagues no many occasions, for example for doing the work in the various beta-programs AMIS is involved in. But I was a little scared of Linux if truth be told. And the idea of creating a virtual machine by myself seemed preposterous.
Then the world changed. Primarily because of a colleague who in so many words told me to get a grip. And of course he was right. And the release of Oracle Database 12c on Linux only (!) was another big stimulus. And after a few days of struggling, googling an frantically asking around, I have managed to get Oracle Database 12c running in Oracle Enterprise Linux 6.4 based Virtual Box VM. I feel like I am on top of things. And in hindsight – it was not such a big deal. My decade of hesitation was quite unjustified.
In this article I would like to show you how I got over my threshold – that seemed so high from one end and turned out so low from the other. Here is how you can get a Virtual Box VM going on OEL in less than one hour.
The steps are:
- Download and install Virtual Box (nothing special, just run the install wizard)
- Download the Oracle Enterprise Linux 6.4 ISO image (3,5 GB) Note: you can pick other Linux distros as well; not however that Oracle Database 12c and onwards will not be available for 32 bit Linux!
- Create a Virtual Machine in Virtual Box – provide a name, the intended operating system, some details about the initial hard disk, configure network properties (I am still struggling a bit here)
- Attach a new DVD device – based on the ISO image
- Start the new Virtual Machine; the ‘DVD’ will run the installer for OEL
- Instruct the installer wizard what to install (include for example the graphical desktop – sorry, I cannot help myself)
- Complete the installer
- Reboot the VM and login => the new VM is done
- Post installation steps
- Export appliance to have it available for reuse
In somewhat more detail:
1. Download and install Virtual Box
Go to http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html and download Virtual Box. Then run the installer. No special settings are required.
2. Download the Oracle Enterprise Linux 6.4 ISO image
Go to https://wikis.oracle.com/display/oraclelinux/Downloading+Oracle+Linux and select a mirror to download the ISO image from.
Just save the file somewhere on your disk.
3. Create a Virtual Machine in Virtual Box
Click on New.
Type the name of the new VM and select the operating system for the machine – Linux and Oracle (64 bit) respectively:
Click Next.
Set the memory size (something you can easily adjust after creating the VM):
Press Next.
Time to define the storage under our new machine. Select the option to create a virtual hard disk now:
Press Next.
Specify Dynamically Allocated – which basically means that the file created on your host to implement this virtual disk will only grow to its final size when in the VM the disk space is actually allocated.
Press Next.
Provide a Name and specify a Size for the disk. Because of the dynamic allocation, I have now qualms about increasing the size of the disk a little. This is something you can not adjust later on – even though you can multiple disks to your vm.
Press Next.
The definition of the VM is presented:
Now comes the part I have been struggling with a lot. The network. I have used the following step – yet whenever the host is not on line, I do not seem to be able to connect to the host from the guest (the vm) or vice versa (connect to the guest from the host). I have also had the problem that the IP address in the host kept changing all the time – making it also impossible to establish a good connection from the host to the guest. My instruction here may not be the final answer: click on settings. Go to Network and change from the default (NAT) to Bridged Adapter:
Open the Advanced section and set Promiscuous Mode to Allow All. Note: the name of the adapter depends on whatever network adapter is available in host.
By default, the Network adapter is created in NAT configuration. This is OK for client machines, but we want to use our VM as a server, so we have to change this into the Bridged adapter.
Next, go to the Storage tab.
4. Attach a new DVD device – based on the ISO image
On the storage tab in the settings dialog, you will see the hard disk we have created earlier on. We now also want to specify a DVD Device. One that is based on the ISO image. This means that the virtual machine will behave as if a DVD player was attached to the ‘computer’ with the Linux Installation DVD loaded and on auto-start. Click on the Add CD/DVD device icon:
Click on Choose Disk in the next dialog:
Select the .ISO file with the OEL 6.4 install image that you downloaded earlier on
The settings dialog is updated with the DVD device:
5. Start the new Virtual Machine
Click on Start
the ‘DVD’ will run the installer for OEL
6. Instruct the installer wizard
aqqq
Check the checkbox to Connect Automically:
Click Apply.
Click Next.
Select your location (timezone):
Specify the root password:
Click next:
Because we are using a new, fresh hard disk we can just use all space. If you mark the checkbox Review and modify partitioning layout, you get an overview of how the installer intends to organize the logical volumes and volume groups:
You do not have to make any changes. Click Next, and after the next screen, click next again.
Accept the next dialog – to write changes to disk (as the disk is still fresh and empty):
Select the type of installation, such as Software Development Workstation:
Make sure the following packages are selected under the category Desktops if you want to have the graphical GNome desktop:
Click on Next. The dependencies are checked.
Now the installation will start.
7. Complete the installer and have the installation run
a lot of packages have to be loaded…
For me it took about 20 minutes.
You next enter the post install wizard (no big decisions, mainly the creation of a new (non-admin) user, for example oracle.
Create a new user:
The system will now reboot.
8. First check and Final post installation configuration steps
After starting up, the following dialog is shown:
Click on user oracle and login with the password set up for that user.
Try to run Firefox – using the icon in the top bar:
If it works, the network adapter eth0 is indeed connected.
Disable the firewall – because this will be a local machine that we probably want to be able to access from the host and other virtual machines:
You may have to provide the root password to perform this operation. In the next screen, click the big disable icon:
and accept (click Yes) the next dialog:
The VM is now set up, ready for use. For example to install Oracle Database 12c – which will be my next step.
Note: Tim suggests a final step: Disable SELinux by editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows. I am not sure what exactly that entails. It may be a good idea.
edit on June 30th 2013:
8b. Configuring the Host-Only Network
Using Marco’s kind suggestions I was able to establish the connection between the host and the guest VM. Like he said, it was pretty straightforward.
In the Virtual Box Preferences, the Network tab presents information about Host-Only Networks. I added one, but the default one served me fine.
I inspected the properties of the default adapter:
This IP address, like Marco said, is the address where the guest VM can access the host.
The DHCP Server tab explains how the Virtual Box DHCP Server for the host only networks dispenses IP addresses. By default, it starts at 192.168.56.101 – the address that will be assigned to the first VM started up with a host only network adapter.
Now on to the configuration of the VM itself. In addition to the first network adapter – set to bridged to allow the VM to access the rest of the world – a second adapter is set up for the VM. This one is of type Host-only Adapter and refers to the default Virtual Box Host-Only Ethernet Adapter.
When next the virtual machine is started, I checked the network situation using the ifconfig command:
The guest VM has been assigned the 192.168.56.101 IP address through its eth1 network connection. This connection by the way can be checked as well:
and its properties are:
Finally, on my Windows host machine I would like to refer to the VM by hostname rather than IP-address. I have edited the WINDOWS/system32/drivers/etc/hosts file and added a line for the IP address 192.168.56.101. Note however that if multiple VMs are started and they are started in a different order, the IP-addresses will be allocated differently.
After saving this file, I started a new command line window and pinged for host orcl12c:
9. Install Guest Additions
Some interesting interactions between host and Virtual Box vm are available when the Guest Additions are installed in the Linux VM. This can easily be done using the following procedure.
In the Virtual Box Devices menu, select the option to Install Guest Additions. This will make Virtual Box attach a DVD device to the VM that will then popup and propose autorun. Accept all dialogs to make the guest additions enabled in the VM.
Now you can enable a shared clipboard between guest and host:
10. Export the VM appliance, to have it available for reuse
The VM we have constructed now, is a perfect starting point for future environment, such as Oracle Database, various Oracle FMW components, Java EE 7 development work etc.
Progress indication is a little flexible..
The final result is a reusable, shippable file:
Resources
Download VirtualBox: http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html.
How to Install Oracle VM VirtualBox and Create a Virtual Machine – http://www.thegeekstuff.com/2012/02/virtualbox-install-create-vm/
Downloading Oracle Linux – https://wikis.oracle.com/display/oraclelinux/Downloading+Oracle+Linux. One of the mirrors where ISO image for OEL 6.4 can be downloaded: http://ftp5.gwdg.de/pub/linux/oracle/OL6/U4/x86_64/
Install Oracle Enterprise Linux in Oracle Virtual Box VM – https://blogs.oracle.com/jaapr/entry/sun_ray_server_on_oracle
Using VirtualBox Host-only Networking to run servers in your lap – https://blogs.oracle.com/fatbloke/entry/virtualbox_vms_with_multiple_vnics
Tim Hall’s instruction on installing Oracle Linux 6: http://www.oracle-base.com/articles/linux/oracle-linux-6-installation.php
Tim Hall’s instructions on installing Oracle Database 12c on top of Oracle Enterprise Linux 6: http://www.oracle-base.com/articles/12c/oracle-db-12cr1-installation-on-oracle-linux-6.php
Superb post. Your detailed steps saved a lot of time for me in the process of OEL setup.
Wonderful post… I was able the do the installation and configuration without any issue.. Thanks a lot..
I have been trying to install Linus on Virtual machine by seeing videos, But I could do that with your step by step post. Thanks a lot.
Hi Lucas
Nice post.
Do you have the similar instructions for oracle soa 12c VM, i tried installing but ran into several problems with my machine. It would be great if you have time to share it.
thank you
Srikant
Hi Srikant,
Thanks for your reaction. I have leveraged the work done by Edwin Biemond – in a similar fashion – for creating a SOA Suite 12c environment. Using Vagrant and Puppet and the work done by Edwin, it is dead easy to get a full blown SOA Suite 12c environment. Please see this article for details: Rapid creation of Virtual Machine(s) for SOA Suite 12.1.3 server run time environment – leveraging Vagrant, Puppet and Biemond
Wonderful post, thank you very much 🙂
Lucas, You are a good guy to spend time with, Big Up.
Absolutely shaking explanation Lucas – i tried and installed the above on virtual box 6.5 version without a single error. But before going through this article. Lucas we met in Hyderabad once during your visit to India related to Oracle Tour. I am following your books videos and other oracle stuff since then. I gone through the SOA book aswell. Thanks Lucas once again.
Hi Ravi,
Thanks for your very kind words! I remember our conversation in Hyderabad. It was important since your remarks helped me decide to start writing the SOA Suite 12c Handbook after all. By now, I am about half way through writing it. Thank you for that stimulus.
warm regards
Lucas
Thank you so much for this howto, very helpfull !!!
I have done a full installation http://kickass.to/oracle-12c-linux-64-virtual-machine-image-t7574823.html
Thanks Marco for your kind words and you excellent explanation of the host-only network. I have tried it out and it works like a charm. I have subsequently updated the article based on your suggestion and my findings.
Lucas
Great post Lucas!
Although a newbie experience, lots of us struggle with the network bit of VirtualBox the first time around. What you can do to create a static TCP/IP connection for the outside world is to ADD a second network adapter with “Host Only-Adapter” which enables you to connect (if it is the first VM machine to get started) to create an outside connection to you VM environment on TCP/IP connection on TCP/IP address 10.0.1.10
For example via a putty session or via my iTerm Apple console while using:
JDBC connections etc, work also for that host tcp/ip number. For more on VirtualBox network settings and configuring of those see:
http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox
Most of the time I have 2 network adapters configured: Adapter 1, Bridged, Adapter 2, Host-only.
Network adapter defaults are configured in the main menu. My host-only adapters are configured on my iMac with the following settings: