Category: VMware


I’ve been tasked with becoming an Oracle DBA, so I need to be able to create an VMware Server image containing 32 bit Ubuntu 8.04.1 Server JEOS and Oracle 10g. Much of the work was taken from Augusto Bott‘s Installing Oracle 11g on Ubuntu Linux 7.10 (Gutsy Gibbon) and Peter Cooper‘s How to Install VMware Tools on Ubuntu Hardy 8.04 under VMware Fusion.

I was able to consolidate the methods to work rather well together. As soon as Ubuntu 8.10 Server JEOS (Intrepid) is released, I’ll verify the procedure on that operating system as well.

If you’re looking for instructions on how to install Oracle 11 XE on Ubuntu 8.04.1, look at Installing Oracle Database XE on Debian, Ubuntu, and Kubuntu by Todd Trichler.

Create a VMware Image with the following settings

  1. Choose 32bit Ubuntu for the OS type
  2. 1024 MBytes RAM
  3. 16GBytes disk space
  4. Ubuntu 8.04.1 (or higher) Server JEOS edition http://www.ubuntu.com/products/whatisubuntu/serveredition/jeos
  5. Upon the os installation, create a non “oracle” id to use to administer the os.

Install the required updates and packages

$ sudo aptitude update
$ sudo aptitude safe-upgrade
$ sudo aptitude install build-essential xinetd linux-headers-`uname -r` openssh-client openssh-server unzip libaio1 gawk ksh rpm libmotif3 alien lsb-rpm libtool libxtst-dev libxtst6 libstdc++5

Add swap

$ sudo dd if=/dev/zero of=/extraswap bs=1M count=1536
$ sudo mkswap /extraswap
$ sudo swapon /extraswap
$ sudo echo "/extraswap   none   swap   sw   0   0" >> /etc/fstab
# <em>"/sbin/swapon -s" should show the added swap space</em>
$ /sbin/swapon -s
Filename        Type    Size  Used  Priority
/dev/mapper/oracle10g-swap_1            partition 401400  92  -1
/extraswap                              file    1048568 0 -2

If VMware Server version is 2.0x or higher, install VMware tools:

$ sudo su – root
$ mount /dev/cdrom
$ cp /media/cdrom/*.gz ~
$ tar zxvf VMwareTools*.tar.gz
$ cd vmware-tools-distrib
$ ./vmware-install.pl

If VMware Server version is 1.0x, install VMware tools:

$ sudo su – root
$ mount /dev/cdrom
$ cp /media/cdrom/*.gz ~
$ aptitude install libgtk2.0-dev libproc-dev libdumbnet-dev xorg-dev wget
$ wget http://mesh.dl.sourceforge.net/sourceforge/open-vm-tools/open-vm-tools-2008.04.14-87182.tar.gz
$ tar xzvf VMware*.gz ; sudo tar xzvf open-vm-tools*.gz ; cd open-vm-tools-2008.04.14-87182/
$ ./configure &amp;&amp; make
$ cd modules/linux/
$ for i in *; do mv ${i} ${i}-only; tar -cf ${i}.tar ${i}-only; done
$ cd ../../..
$ mv -f open-vm-tools-2008.04.14-87182/modules/linux/*.tar vmware-tools-distrib/lib/modules/source/ ; cd vmware-tools-distrib/
$ sudo ./vmware-install.pl
$ sudo reboot

Append to /etc/sysctl.conf

$ sudo cat >> /etc/sysctl.conf << EOF
fs.file-max = 65535
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65535
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
EOF

Append to /etc/security/limits.conf

$ sudo cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535
EOF

Append to /etc/pam.d/login

$ sudo cat >> /etc/pam.d/login << EOF
session required /lib/security/pam_limits.so
session required pam_limits.so
EOF

Set up user / groups

$ sudo su – root
$ addgroup oinstall ; addgroup dba ; addgroup nobody ; usermod -g nobody nobody ;  useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
$ passwd oracle
Password changed.
$ mkdir /home/oracle ; chown -R oracle:dba /home/oracle ; ln -s /usr/bin/awk /bin/awk ; ln -s /usr/bin/rpm /bin/rpm ; ln -s /usr/bin/basename /bin/basename ; mkdir /etc/rc.d
$ for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
$ mkdir -p /dbms/oracle ; chown -R oracle:dba /dbms/oracle ;  sysctl -p
$ reboot

Retrieve Oracle 10g zip file

  1. Copy the Oracle install zip file from disc or somewhere
  2. Unzip it

Retrieve IP of the network card

$ ifconfig |grep "Bcast"

Install / Configure oracle manually verifying any requirements:

$ ssh -C -X oracle@(ipaddress)

$ cd /home//database
$ ./runInstaller -ignoreSysPrereqs

iSQL*Plus URL:

http://(ipaddress):5560/isqlplus

iSQL*Plus DBA URL:

http://(ipaddress):5560/isqlplus/dba

Enterprise Manager 10g Database Control URL:

http://(ipaddress):1158/em

I’m sorry folks, I got wrapped up in the ways of the physical world and then was sick the past few days.

Recently I tried installing vmware tools in a Ubuntu 8.04.1 JEOS Server virtual machine with no success.  After a bit of googling, I came across the Peter Cooper’s blog that outlined the procedure rather well for VMware Fusion, but it works for VMware Server and VMware Workstation just fine.  Essentially:

  • download Open VM Tools from Sourceforge
  • Mount VMware tools (Host -> VM -> Install VMware Tools), mount /dev/cdrom
  • Extract the vmware tools to /tmp
  • Extract and compile Open VM Tools (./configure)
  • Tar up the compiled open vm tools and copy to the vmware tools directory
  • Run vmware-install.pl

See Peter’s blog for step by step instructions.

Don’t know what VMware VMotion is? VMotion allows you to easily move one virtual machine to another VMware ESX host that is connected to the same storage mechanism (presumably SAN) with no downtime. Looks promising :)

Image courtesy of VMware

Image courtesy of VMware

Dell has a demonstration using Microsoft SQL Server where they move the live SQL Server from one blade to another with no outage:

I thought it would be possible to add a virtual device file to a running virtual machine and have it show up in the virtual machine without restarting the virtual machine.  I was wrong.  The current VMware Server 1.0.6 is incapable of doing this.  What you can do is to set up the device file so all you have to do is to restart the virtual machine, minimizing downtime to a couple of minutes:

  • Create a new 20GB preallocated disk in the D:\Virtual Devices\DBA Dev 1\Disk4 directory:

D:\Virtual Machines\DBA Dev 1\Disk 4>vmware-vdiskmanager -c -a buslogic -s 20Gb -t 3 Disk4.vmdk
Using log file C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\vmware-DBH1admin\vdiskmanager.log
Creating a split preallocated disk ‘Disk4.vmdk’
Create: 100% done.
Virtual disk creation successful.

  • We need to determine which device slots are available.  Go to VM->Settings and look at the next free scsi device #
  • Associate the new virtual device file using the free scsi4 slot

D:\Virtual Machines\DBA Dev 1>vmware-cmd “D:\Virtual Machines\DBA Dev 1\Ubuntu.vmx” setconfig scsi4:1.fileName “Disk 4\Disk4.vmdk”
setconfig(scsi4:1.fileName Disk 4\Disk4.vmdk) = 1
D:\Virtual Machines\DBA Dev 1>vmware-cmd -v “D:\Virtual Machines\DBA Dev 1\Ubuntu.vmx” setconfig scsi4:1.present true
API Version: 1.01
setconfig(scsi4:1.present true) = 1

After you restart the virtual machine, the device will now show up when you run fdisk -l.

You’ve probably seen it, you copied an Ubuntu Linux virtual machine under VMware and tried starting it up with a new VMware UUID and the networking doesn’t work.  When you use a new VMware UUID, it will change the mac address on any virtual network device you have configured in the virtual machine.

A very simple ‘fix’:

In /etc/udev/rules.d/70-persistent-net.rule, delete the entry for your network device(s) so the new mac address is recognized on reboot.  It will look something like so:

# PCI device 0×1022:0×2000 (pcnet32)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:0c:29:aa:4c:75″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″

Your network devices will now be working.  Don’t forget to reboot your virtual machine.