Home > debian, Interesting > Using Oracle with Vagrant

Using Oracle with Vagrant

Problem:
This was a major issue for me. I needed Oracle 11g Database on my laptop.

Solution:
One of the possible solutions I took was to use vagrant. (I am pretty much just going to repeat the same steps as per what I got from the website listed in the Sources section below.)

1. Download and install Vagrant
2. Download and install VirtualBox
3. Download the Oracle 11g zip file for Linux x64
NB. Always download the Linux x64 zip file, even if you are on Windows or Mac OSX.
4. Clone the vagrant-ubuntu-oracle-xe repository from GitHub
git clone git://github.com/hilverd/vagrant-ubuntu-oracle-xe
5. Copy the Oracle 11g zip file to the directory vagrant-ubuntu-oracle-xe expects to find it in
cp ~/Downloads/oracle-xe-11.2.0-1.0.x86_64.rpm.zip ~/vagrant-ubuntu-oracle-xe/modules/oracle/files
6. Install vbguest
vagrant plugin install vagrant-vbguest
7. Invoke Vagrant to install and configure Oracle 11g
cd ~/vagrant-ubuntu-oracle-xe
vagrant up

After a few minutes your local machine will be running an Oracle 11g server on a virtual instance of Ubuntu 12.04

Well… not exactly.
1. I had run out of space on my / partition. I couldn’t install the new linux header files that were needed. The quickest thing for me was to format my machine. This time round I gave a bit more GBs to / partition.
2. Added some mirrors to /etc/apt/sources.list
3. root> apt-get update
4. First mistake I made was not to do apt-get dist-upgrade
5. So, oblivious of that, I followed steps 1 to 7, but vagrant up brought more errors
6. The kernel version on my machine and the latest linux-headers- being seen by virtual box were not the same. I was getting an error similar to this. (It was late and I did not have the presence of mind to save the errors. Sorry.)
$ VBoxManage --version
WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-ose-dkms package and the appropriate
headers, most likely linux-headers-generic

You will not be able to start VMs until this problem is fixed.
X.X.XX_DebianXXXXX

7. Googled a bit. All references to above error were advising the OPs to do the following
apt-get install linux-headers-$(uname -r)
8. But above did not work since I could not find the linux-headers for the current system version that I had.
9. After 2 or 4 hours, I realised that I needed to get my kernel (3.14) to the same version as what was installed (3.16), so read about configuring kernels but the steps were too hard for my already fried brain. At this point I stumbled accross an page explaining what apt-get does. And thus I tried dist-upgrade with the hope that it would upgrade my kernel.
10. Ran the below command
root> apt-get dist-upgrade
11. Once that was done, I rebooted and sure enough my kernel was now 3.16
12. vagrant up now runs
13. So this install would have gone a whole lot more smoothly if I had updgraded my machine before I started this exercise. I’m much older and wiser 🙂

Source:
https://wiki.kuali.org/display/KULRICE/Install+Oracle+11g+using+Vagrant
https://help.ubuntu.com/community/AptGet/Howto

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s