Monday, February 28, 2011

Screencasting in Linux

To create screencast in Linux there lots of Open Source applications but I found RecordMyDesktop the easiest one to use.

Installing of recordmydeskop is straight forward under most of Linux distributions and there is a chance that its available in your Linux distro repository.

Installing on Fedora 13

sudo yum install gtk-recordmydesktop

Or prefer to install QT based which is the fork of gtk based then,

sudo yum install qt-recordmydesktop

Using recordmydesktop is very easy and its do not require any explanation, but still interested in learning more about then refer to recordmydesktop documentions.

Sunday, February 13, 2011

Installing Oracle 11gR2 on Centos 5.5 64bit

1. The /etc/redhat-release should be faked to show Red Hat Enterprise Linux Server release 5 (Tikanga). same goes for /etc/issues file.
But to be sure apply this settings (backup /etc/redhat-release and /etc/issue before) change existing value to
Red Hat Enterprise Linux Server release 5 (Tikanga)

2. Install fake redhat-release RPM file from http://ivan.kartik.sk/

rpm -i centos-fake.noarch.rpm

3. Create Required UNIX Groups and User (For detail check http://download.oracle.com/docs/html/B15521_01/toc.htm)

# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba

# /usr/sbin/useradd -g oinstall -G dba oracle

Enter the following command to set the password of the oracle user:

# passwd oracle

4. Create Required Directories
Create directories with names similar to the following and specify the correct owner, group, and permissions for them:

    * /u01/app/oracle (the Oracle base directory)
    * /u02/oradata (an optional Oracle datafile directory)

# mkdir -p /u01/app/oracle
# mkdir -p /u02/oradata

#

Change the permissions on the directories that you created to 775:

# chmod -R 775 /u01/app/oracle
# chmod -R 775 /u02/oradata


Depending on the oracle user's default shell, make the following changes to the default shell start-up file:

    * For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the /etc/profile.local file on SUSE systems):

      if [ $USER = "oracle" ]; then
              if [ $SHELL = "/bin/ksh" ]; then
                    ulimit -p 16384
                    ulimit -n 65536
              else
                    ulimit -u 16384 -n 65536
              fi
      fi

Fulfilling package requirements:

       kernel-headers-2.6.18-194.el5.x86_64.rpm \
           glibc-headers-2.5-49.x86_64.rpm \
           glibc-devel-2.5-49.x86_64.rpm \
           libstdc++-devel-4.1.2-48.el5.x86_64.rpm \
           compat-db-4.2.52-5.1.x86_64.rpm \
           libgomp-4.4.0-6.el5.x86_64.rpm \
           gcc-4.1.2-48.el5.x86_64.rpm \
           gcc-c++-4.1.2-48.el5.x86_64.rpm \
           sysstat-7.0.2-3.el5.x86_64.rpm \
           unixODBC-2.2.11-7.1.x86_64.rpm \
           unixODBC-devel-2.2.11-7.1.x86_64.rpm \
           libXp-1.0.0-8.1.el5.i386.rpm \
           libstdc++-devel-4.1.2-48.el5.i386.rpm \
           unixODBC-2.2.11-7.1.i386.rpm \
           unixODBC-devel-2.2.11-7.1.i386.rpm \
           libaio-devel-0.3.106-5.x86_64.rpm \
           elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm \
           elfutils-libelf-devel-0.137-3.el5.x86_64.rpm \
           compat-gcc-34-3.4.6-4.x86_64.rpm \
           compat-gcc-34-c++-3.4.6-4.x86_64.rpm \
           gdb-7.0.1-23.el5.x86_64.rpm \
           libtermcap-devel-2.0.8-46.1.x86_64.rpm \
           readline-devel-5.1-3.el5.x86_64.rpm \
           glibc-devel-2.5-49.i386.rpm \
           libaio-devel-0.3.106-5.i386.rpm


Install Oracle Database 11gR2

1. Download the linux.x64_11gR2_database_1of2.zip and linux.x64_11gR2_database_2of2.zip from www.oracle.com
2 unzip both archive this will give one database directory
3. cd database directory and run ./runInstaller (the installer must be run as oracle user)

Tuesday, February 1, 2011

Installing KVM guest using virt-install tool

These has been tested on Centos 5.5 64bit host.

1. KVM Guest installation with virt-install using default networking and storage image created automatically.

virt-install \
     --name ubuntu_server \
     --ram 256 \
     --disk path=/var/lib/libvirt/images/ubuntu_server.img,size=5 \
     --network network:default \
     --accelerate \
     --vnc \
     --cdrom FullPathTo.iso

2. KVM Guest installation with virt-install using bridging interface, and storage image file created with qemu-img

For this its assume that bridge 'br0' interface is already configured on host, refer to how to create bridge interface on Redhat/Centos.

a) To create storage image
# qemu-img create -f qcow2 /var/lib/libvirt/images/ubuntu_server.img 10G

b)
virt-install \
     --name ubuntu_server \
     --ram 256 \
     --os-type='linux' \
     --disk path=/var/lib/libvirt/images/ubuntu_server.img \
     --network bridge:br0 \
     --accelerate \
     --vnc \
     --cdrom FullPathTo.iso

3. Install a KVM in text mode from remote http server, storage image created with qemu-img. Check (a) for creating storage image

virt-install \
              --name centos2 \
              --ram 256 \
              --os-type='linux' \
              --disk path=/var/lib/libvirt/images/centos2.img \
              --network network:default \
              --nographics \
              --location http://mirror.switch.ch/ftp/mirror/centos/5.5/os/x86_64/ \
              --hvm \
              --extra-args console=ttyS0

Note: --extra-args will only work when performing a guest install from "--location", when doing install from local ISO image it should be mounted somewhere

Tips for completing the installing of guest operating system

1) To Connect from remote PC/laptop

1. install virt-viewer on your local pc

2. Upload your ssh public key to KVM host /root/.ssh/authorized_keys (For this you should allow root login in /etc/ssh/sshd_config)

3. Run the following by replace KVMHostIP with KVM host IP address and vmName with the KVM virtual machine name.

$ virt-viewer -c qemu+ssh://root@KVMHostIP/system vmName

To connect KVMs from the KVM Host

To connect using the virt-viewer tool, run the following command:
# virt-viewer vmName

To connect using the virt-manager tool, run the following command:
# virt-manager vmName

Auto start KVM VMs on Host system boot

The following command will mark the VM for auto start on system reboot

# virsh autostart vmName