Ubuntu


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.

References:
http://www.sourceslist.eu/
https://help.ubuntu.com/community/EOLUpgrades
http://ubuntuforums.org/archive/index.php/t-1078737.html
https://help.ubuntu.com/community/Repositories/Ubuntu
http://svenand.blogdrive.com/archive/50.html
http://www.simplehelp.net/2007/04/27/how-to-install-ubuntu-feisty-fawn-in-os-x-using-parallels-a-complete-walkthrough/
http://download.parallels.com/doc/Parallels_Workstation_2_2_User_Guide.pdf
http://ubuntuforums.org/showthread.php?t=604052
http://forum.parallels.com/showthread.php?t=20921
http://mazimi.wordpress.com/2007/06/26/enabling-audio-in-vmware-server/

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 http://127.0.0.1:8080/apex 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 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
hostname)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

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

I was working on a Rails application recently that required the logs to be sent to remote log server. This blog is just a summary of the steps to get it working. I used Rails 2.0 and the development was done on Ubuntu.

The first thing was to get syslog-ng. Its more advanced than syslogd.

sudo apt-get install syslog-ng

The next step was to get the SysLogLogger tool to send the logs to syslog instead of a file. Go to the vendor directory of your application and get SysLogLogger using the following command.

curl http://rubyforge.org/frs/download.php/20520/SyslogLogger-1.4.0.tgz
-L | tar -zxvv

Assuming that you are working in the development environment , add this to the start of the development.rb file in the configuration directory

$:.unshift File.join(RAILS_ROOT, "vendor", "SyslogLogger-1.4.0", "lib")
require 'syslog_logger'
RAILS_DEFAULT_LOGGER = SyslogLogger.new(program_name = 'my-application')
config.logger = RAILS_DEFAULT_LOGGER

Locate the syslog.conf file in the etc directory and add these lines.

!my-rails-application
user.* /var/log/development.log


What this does is gets the logs that are sent to syslog from the rails application and writes it to the development.log file in /var/log/ dir

To get the changes working, restart the syslog service on Ubuntu by running the following command
sudo /etc/init.d/sysklogd restart

To send the logs to a remote log server instead of the log file use this in the syslog.conf file instead
user.* @address of remote log server

The log server should be configured to accept logs from remote systems. The syslogd file in the remote log server needs to be changed to show the following for this purpose

SYSLOGD="-r"

The syslogd file is located in the etc/default dir in Ubuntu. Since I had the log server configured already, I did not need to change the configuration. Please add comments on this post in case something is missing.

The log files can be rotated on a periodic basis (or depending on size) by configuring the logrotate.conf file in the etc dir.
See man logrotate for details.

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
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.

LD_LIBRARY_PATH=/opt/oracle/instantclient
export LD_LIBRARY_PATH

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.

PATH=$PATH:/opt/oracle/instantclient
SQLPATH=/opt/oracle/instantclient
export SQLPATH
TNS_ADMIN=/opt/oracle/instantclient
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 11.1.0.6.0 - Production on Fri Dec 21 12:57:36 2007

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


ERROR:
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

References:
http://ubuntuforums.org/archive/index.php/t-92528.html
http://roqet.org/oracle_instantclient.html
http://ruby-oci8.rubyforge.org/en/InstallForInstantClient.html
http://craiccomputing.blogspot.com/2007/01/using-oracle-as-backend-to-rails.html
http://ubuntuforums.org/archive/index.php/t-535311.html
http://rubyforge.org/forum/forum.php?thread_id=13948&forum_id=1078
https://help.ubuntu.com/community/EnvironmentVariables

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

Powered by ScribeFire.

I recently got inspired to try out Ubuntu and being a newbie I wanted to have the best of both worlds (Windows and Linux). The solution was simple; get two systems and use a KVM switch. I found a Belkin KVM in my office for my need and thats where all the mess started.

I connect my systems and nothing responds. Not even XP. I had no manual to begin with (and I didn’t think it necessary to have one; after all its just a KVM switch; thats where I went wrong). After a lot of shots in the dark I finally decide to look for the manual to at least know if I had tried the right hot keys. I google “F1DK102U Manual” and this is the link I get.Well, it doesn’t look like the product that I have…..hmmmm does Belkin have the same model number for the two products? After some searches I get to this link product information on Belkin’s website. Seems like they do support Linux (says in the manual) and they have some kind of installation software for Mac and Windows (none for Ubuntu/ Linux). There is no physical switch on the device and so I don’t have an option. I install the software for Windows and it works fine. Nothing for Linux though. After spending a few hours looking at forums, reading blogs and trying out on my own, I give up. This Belkin switch does not work for Linux even though the manual says so.

I look for other alternative switches and am recommended to try the Trendnet or the Iogear KVM switch. I decide to go for the Iogear. No softwares for this one, but Ubuntu doesn’t work again. A similar switch works for a friend for Ubuntu but not for me. I get the controls for the keyboard and the mouse but not for the LCD monitor(Dell 1907FPt). I try the monitor by connecting to the system that runs Ubuntu directly and the monitor does not work. (it used to before I tried the switches). I look for posts on the Ubuntu forums to see if someone ran through similar problems.

I look at the xorg.conf file in my /etc/X11 folder:

Section "Monitor"
Identifier "DELL 1907FP"
Option "DPMS"
EndSection

I don’t see the horizontal and vertical frequecy mentioned so I install xresprobe

sudo apt-get install xresprobe

and get the horizontal and vertical frequencies

sudo ddcprobe | grep monitorrange

I make a backup of my xorg.conf file

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bkup

and change to make the monitor section to look like this

Section "Monitor"
Identifier "DELL 1907FP"
Option "DPMS"
HorizSync 30-81
VertRefresh 56-76
EndSection

It doesn’t work for me. So, I remove the changes I made to the file. I find a really detailed help page (see here)for fixing video resolutions (not exactly what I am lookng for) that describes a lot of things related to video in general. I try to rebuild my xorg.conf file

sudo dpkg-reconfigure -plow xserver-xorg

I mess up my file and Ubuntu fails to start. I go to safe mode and get a backup of my file, restart and try again with something else. This happens a few times and then I see a section that explains installation of newer drivers. I look at my xorg.conf file and see that the driver that I use is for i810.

Section "Device"
Identifier "Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller"
Driver "i810"
BusID "PCI:0:2:0"
EndSection

Could that be the reason? How can I be sure?
I now use the live CD to get into Ubuntu and look at the xorg.conf file. It mentions the driver as “intel”. Thats all I need. I change the driver to “intel” and restart. Fails again. Now what??
One last try ….I re-install the intel driver.

sudo apt-get install xserver-xorg-video-intel

and change my xorg.conf file once again to Driver “intel”
The driver is installed and the i810 driver is removed. No wonder I had a failure in the last step. Using the KVM switch must have removed the “intel” driver and installed the older ‘i810″ one. Doesn’t Ubuntu keep two drivers for the same device?
Anyways…..I restart and the changes work for me. No problems with resolution no problems with the mouse/ keyboard. I try my Microsoft Ergonomic 4000 keyboard and that works fine too. Nothing better.

Finally, this is what Belkin Customer Support had to say:

We understand that you are not able to install this device on Linux operating system.
As if now we don`t have drivers for this device to install it on Linux computer. We are still under progress and drivers will be released soon. Once the drivers are released it will be posted at : http://www.belkin.com/support/article/?lid=en&pid=F1DK102U&aid=9081&scid=0

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

Powered by ScribeFire.