I have two systems setup with Ubuntu and Windows XP with a KVM switch; I have also tried dual boot in the past. These configurations definitely gave me the advantage of both worlds, but I wanted to run Linux and Windows on the same system without any KVM or dual boot. Recently, Parallels was giving out a free license for Parallels Workstation 2.2 so I thought of giving it a try. The irony was that I ended up using Vmware. Here is a short summary of what happened.

I installed Parallels Workstation 2.2 and started to create a VM. The process of creating a VM is very intuitive and I decided to use a typical install.(See this in case you need an idea of the process) I used an empty partition from my XP. When I tried to install Ubuntu on it, it asked me if I wanted to install it on the 31 GB drive. As far as I remembered I had the partition for 13 GB. Fearing that I would screw up my MBR (I have done that before), I quit. Later I realized that the typical install of Parallels created a 32000 MB expanding hard disk and thats the reason it showed me a partition of ~31GB. I created a new VM with higher RAM and lower hard drive space. Now when I tried to install Ubuntu 8.04 it showed me an error in the installation (an odd image with 1’s). When I tried to install Ubuntu 7.04 it froze after sometime during the installation. Surfing through the net I found that other users have come across the same problem and it seems that allocation of higher RAM creates a problem. So, the third time I created a typical install again but changed the hard drive space after the VM was created. So far so good. I had a CD for Ubuntu and 7.04 and I went for the install. Parallels install notes mentions that they support 7.04 and 7.10; I was hoping to upgrade to higher versions once I got 7.04 installed. The installation was smooth. Upgrade was where the problem came. The 7.04 has reached the End Of Life and so I kept getting “could not find the release notes” when I tried to upgrade. I changed the sources.list file (see here) and upgraded to 7.10. Upgrading to 8.10 was another problem. Each time I upgraded, the network would get disabled. This writeup helped me solve the problem. After upgrading to 8.10 I hit a major roadblock. Network failed; could not upgrade anymore; I gave up. This was enough for me with Parallels.

Having spent so much time to try out getting a VM, I decided to give VmWare a try too. I downloaded the VmWare server and installed it. Much to my dissapointment, it installed VmWare webacess and server on my machine and I couldn’t access the webaccess anyways. I was expecting a shortcut that would fire a tool that would help me create a VM. I looked at the website and saw at the range of their products. Now I wasn’t sure if it was VmWare Server that I needed or was it the Workstation and the Player. Finally, I figured it out. The server was not started on my box. I used Administrative Services to fire the service and access the VmWare Server Webacees. The webaccess provides the dashboard to create and manage VMs. Having spent time on Parallels, the process was quite simple. The problem was that Ubuntu wouldn’t start up from the live cd. I realized that I had to add remote tools on the VmWare server in order to proceed. Rest was easy. I now have Ubuntu 8.10 on my Windows XP. To get the network connection working, put the network type as NAT instead of ‘Bridged Network’ in the Network Adapter configuration of your VM. Here is a summary of how to get the sound working. Important: To make things work, you will need to add a password to the account on your host (Windows) that has the guest(Ubuntu). Somehow, an account with no password gives problems in getting to the VmWare webaccess.
What next? Will try to upgrade Ubuntu to Jaunty.


Technorati Tags: , , , , ,

Its been a while that I have been trying to set up a development environment on my box at home. One of the challenges was using MySQL. (Its not that there is anything wrong with MySQL; its more of a procrastination problem with me. 🙂 to move to something other than Oracle. I have been working on Oracle for sometime and I was keen on getting the same environment for my development at home.)

I tried Oracle Express Edition today and was amazed at its simplicity. I was up and running with some sample code in a couple of hours. I downloaded the deb package on my Ubuntu and the installation was as easy as clicking the package and running this command sudo /etc/init.d/oracle-xe configure
Here is a good article that spells out some details. But it was way easier for me. Once all the ports were configured and the database server installed , the management was easy. I used url to get to the admin screen.(use the same ports that you specify when configuring the server) Creating users, configuration was all intuitive.

There is a tasks menu on the right side of the page that shows a link “Manage Http Access”. If you enable remote access by going to that page, the admin panel can be accessed from any other system remotely.

I couldn’t get the PL/SQL developer to work on the client machine to talk to the server, but SQL Developer did not give me any problems. PL/SQL Developer had problems with the tnsname but SQL Developer worked. Not sure why. Here is the tns configuration I used: (Got it from here)

XE =
hostname)(PORT = 1521))

And this is the connection url that I used from my application code:
jdbc: oracle:thin:@hostname:1521:XE

Now that I have a new playground, I hope to add more to my blog soon.

Other Links:
JDBC Driver
Oracle XE download for Linux

Having fixed the problem with the KVM switch on my machine I proceed to get my Ruby scripts working on Ubuntu. Installing Ruby and getting Rails is a breeze. The problem starts when I need to install ruby-oci8. You cannot get this by doing a gem install….need to download the tar.gz file and run the setup. I try to use tar -xvf ruby-oci8-1.0.0.tar.gz but it fails. (some problem with the header of the file). I then use gzip and tar commands separately and it works.

To install ruby-oci8 you can either do this

make install

or do this

ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

When I try them, both fail. Looking at the error I see that I need to configure ORACLE_HOME (in case of Oracle) or need to configure LD_LIBRARY_PATH (in case of Oracle Instant Client). I know that I don’t have them on my machine so I proceed to get the Oracle Instant Client. I read some blogs (see References) and find that I need the basic.zip and sdk.zip packages. I download them and unzip them at this location /opt/oracle/instantclient (need to sudo). Having done that I set my LD_LIBRARY_PATH to /opt/oracle/instantclient.


I then proceed to create two symlinks

ln -s libclntsh.so.11.1 libclntsh.so
ln -s libocci.so.11.1 libocci.so

Note: In the above case, the names would depend on the version of the instant client that you have.

I go back to try out the ruby-oci8 setup and it fails again. Back to square one and I seem to have run out of ideas. A friend suggests me to check if the instant client works properly by installing sqlplus and connecting to the database. I go ahead with that (I would need sqlplus anyways).
I get the sqlplus.zip file from here. Unzip it to the location /opt/oracle/instantclient. I now go ahead and set the environment variables through the command line. (I have the LD_LIBRARY_PATH set already) and add my tnsnames.ora file to the same location.

export SQLPATH
export TNS_ADMIN

I try this command at the command line now. (where the username , password and tnsnames have appropriate variables)

sqlplus username/password@tnsname

I get this now:

sqlplus: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

What the !! Now what is this supposed to be?? I read more and run these commands:

ldd sqlplus
strace sqlplus

The first command gives me a list of library dependencies that sqlplus requires and the second command (strace) gives me a trace of system calls and signals. (see man pages of the command for details). Both indicate that a library (libaio) is missing. I run the following command :

sudo apt-get install libaio-dev

Now when I try to run sqlplus I get this error:

SQL*Plus: Release - Production on Fri Dec 21 12:57:36 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

ORA-12154: TNS:could not resolve the connect identifier specified

At least I am close. Hmmm…problem with the tnsnames. Soon, I find that I had set TNSADMIN instead of TNS_ADMIN. sqlplus runs once i correct that. So, I can now connect to the database and am sure that the instantclient is installed correctly. Back to ruby-oci8 now.
Running the setup gives me the same problem. This time however I notice that the instantclient is recognized but there is this error (I guess the instantclient was not the problem after all …doh !!)

checking for cc... ---------------------------------------------------
error messages:
Permission denied - mkmf.log

I see that mkmf.log exists in the oci8 dir structure and has root privileges. So, I need to run the setup as root. But since all the environment variables are set on my login the setup complains that it does not see LD_LIBRARY_PATH. I go ahead and add all environment variables to /etc/profile. For global environment variables in Ubuntu see this. I restart my shell and run the following.

sudo -i
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

Success. oci8 now installs without complaints. I try my ruby scripts and everything looks good. The fruit of persistence is definitely sweet.

UPDATES: I was helping a friend install oci8 on his machine when we faced some more hurdles. Adding them here:

1. mkmf not found: You will need the development version of Ruby. sudo apt-get install ruby1.8-dev
2. Make sure you install 32 bit versions and not 64 bit ones.
3. If you see this error : “libsqlplus.so: cannot open shared object file:”, you are missing the instantclient path. Somehow adding the path in /etc/profile did not get picked up in our case. We had to add it in the .bashrc file. Make sure you open a new terminal after the changes.
4. If you have problems running ruby setup, install etc (see the last step above), check to see if you have the build-essential package installed: sudo apt-get install build-essential


Technorati Tags: , , , , , , , , , , ,

Powered by ScribeFire.