Oracle DBA Tips Corner |
|
Creating a New Virtual Machine - (White Box Enterprise Linux)
by Jeff Hunter, Sr. Database Administrator
Contents
Overview
Why post an article like this on the Oracle DBA Tips section of my website?
Well, the WMware Workstation product provides a unique opportunity for
me to have Windows XP (Professional) running on my laptop with the ability to install
another operating environment (Linux, Solaris x86, or even another version
of Windows) - all on the same machine without the need for dual-booting.
VMware provides me with a virtual machine that can run any of the
above mentioned operating systems simultaneously with Windows XP on my laptop.
I often find it necessary to do new installs or unique configurations of Oracle on Linux while not
wanting to disturb my somewhat stable Oracle install on the laptop.
In VMware Workstation, a virtual machine is nothing more than a directory
of several files. After creating a virtual machine, (Linux, Solaris, etc.),
I typically
close down the VM and backup that directory to my NAS. Once
this directory is backed up, I have a complete copy of the virtual machine
that can be restored at any time. This gives me the ability to install
and configure Oracle on the virtual machine without the worry of messing anything
up that would otherwise take a long time to fix (or re-install the O/S). When I want
to go back to a fresh virtual
machine, I simply restore the directory and I am done - back to a fresh install.
As previously mentioned, I prefer to run Windows XP Professional on my main
laptop along with the most recent releases of Oracle9i and Oracle10g
for Windows on that laptop.
I also, however, need the ability to work with different Oracle configurations on Linux
when I have only my laptop. Although I have several Linux and Sun machines
at home, I may be on the road with no access to my vast array of equipment.
This is where both VMware and White Box Enterprise Linux come in handy.
For installation instructions on installing VMware Workstation 4.5 on to the
Windows XP Professional operating environment, see my article entitled
"Installing VMware Workstation 4.5 - (Windows XP)".
Host Machine and Virtual Machine Configuration
About White Box Enterprise Linux
Use the following link to download White Box Enterprise Linux 3.0:
Creating a New Virtual Machine for Linux
The first screen is simply a Welcome screen. Click [Next] to
start the virtual machine creation process.
The default option in this screen will be to create a 'Typical' configuration. Change
this option to 'Custom' and click [Next] to continue.
You are now asked for what guest operating system will be installed to
this new virtual machine. Although we are using White Box Enterprise Linux,
we will be choosing Red Hat Enterprise Server 3. Remember that these two
distributions are identical with the exception of a few logo changes.
Choose 'Red Hat Enterprise Server 3' and click [Next] to continue.
VMware Workstation uses a user defined name to identify each virtual machine.
The default name is the same name as the guest operating system that you chose
for the new virtual machine. I typically change this to the server name (host name) I will
be using for the virtual machine. For the purpose of this example, my new server
name for the virtual machine will be "vmlinux1" so this is what I will type
in for the name and the directory. You can, however, simply leave it to the default.
This is a matter of choice and what you want to name the new virtual machine. After
deciding on the name for the virtual machine, click [Next] to continue.
Both Oracle9i and Oracle10g require a minimum of 256MB of RAM memory although
more memory is always better for performance. In my case, I do have the memory to spare and will be
giving the new virtual machine 512MB of memory given that I have 1GB of RAM on my laptop.
Select the amount of memory you want to dedicate to the new virtual machine and
click [Next] to continue.
You are now being asked for the network configuration. I typically keep the default, which is
a bridged network. This allows other computers on my network to access the virtual
machine. The other option, NAT allows your virtual machine to share the same IP
address of your physical (host) machine. Do not select the NAT option as the Oracle installation
will fail. The third option, host-only networking, allows only your physical (host) machine
access the new virtual machine. If you select this option, other computers on your
network will not be able to access the new virtual machine, but the Oracle install will
still be successful. After making your network choice, click [Next] to continue.
I always accept VMware's default option regarding the SCSI adapter to be
used and click [Next] to continue.
Once again, keep the default option of "Create a new virtual disk" selected and
click [Next] to continue.
You now need to choose a disk type. I always keep the default option which for Linux
makes
the new virtual disk a SCSI disk. Yes, this works even though you may have no
SCSI I/O disks in your system. There is no performance differences by choosing
IDE or SCSI here. Keep in mind that the system will only perform to what you
actually have installed physically. If you do choose IDE, however, you will be limited
to a max of 4 disk that can be attached to the virtual machine. In almost all situations,
this will make no difference, but I do like having the SCSI option as it is more
flexible to my machine needs. Click [Next] to continue.
Since I will be using this new virtual machine for Oracle, I will need
a minimum of around 6GB (O/S files, RDBMS Software and new Oracle Database).
Even at 6GB, space is going to be tight. I would recommend somewhere between 8GB and 10GB
of space. I have the spare on my laptop, so I made mine 10GB. By default, the entire space
you request here is not immediately allocated. As VMware needs more space for the virtual machine,
it will allocate it to the upper limit you supply here. Since I know that I will be using
most of the space, I like to pre-allocate this space. You can pre-allocate this space (in my case 10GB)
by selecting the check-box "Allocate all disk space now".
After selecting the disk size, click [Next] to continue.
If you elected to
have the disk space pre-allocated, you will be given a warning that this
process can take a long time and some programs running on your system
may become unresponsive. I have never had an issue with pre-allocating space
and simply acknowledge this message.
WMware Workstation implements a virtual machine by using a disk file. This screen
allows you to name the VMware file. It really doesn't matter the name of this
file. I do, however, like to change it to the server name of the new virtual
machine. Again, this is simply a matter of choice and any name will be fine.
Make your selection and click [Finish] to start the creation process
for the new virtual machine.
After hitting the [Finish] button, the virtual machine process begins.
If you selected to have the space for the new virtual disk pre-allocated, you will
get the (above) "Create the disk" progress dialog.
If everything goes successful, you will have the new virtual machine in your
"Favorites" list.
Optional Virtual Machine Configuration Steps
Some considerations are removing floppy drives and sound cards. In my configuration,
the only device I want to remove is the audio device. Select the
"Edit virtual machine settings" and navigate to the device you want
to remove. The following screen shot shows how to remove the audio device:
Installing White Box Linux Enterprise
As I did in the previous section for creating the new virtual machine, I
provide all screen shots for installing White Box Enterprise Linux to
our new virtual machine.
The first screen is the boot screen. At this point, you can add any type
of boot options, but in most cases, all you need to do is press [Enter]
to continue.
You can choose to verify the CD media in this screen. I know that the ISOs
that I burnt to CD were OK, so I typically choose to Skip the media check.
After checking your media CDs (or if you are like me and Skip this process),
the installer then starts to probe for your video device, monitor and mouse.
The installer should determine that the video drive to use is VMware.
It will detect the monitor as Unknown (which is OK). It then probes and finds
the mouse. Once this process is done, it will start the X Server.
After the installer starts the X Server, you should have the Welcome screen.
Click [Next] to continue.
The installer should choose the correct language by default.
Click [Next] to continue.
The installer should choose the correct keyboard by default.
Click [Next] to continue.
The installer should choose find the correct mouse for your system by default.
Click [Next] to continue.
The installer is now asking for the type of Linux install to perform.
The best choice here is "Custom". This will allow us to (later on
in the install process) to choose the packages we need for Oracle and to eliminate
those that you may not need.
Choose Custom and click [Next] to continue.
You now need to select the method to use for partitioning the disk.
For virtual machines, I typically choose to perform an Automatic Partitioning
method.
Click [Next] to continue.
You will be prompted with a dialog asking, "Would you like to Initialize this drive, erasing
ALL data". Answer [Yes] to this dialog.
This is a new virtual machine and there is no data to loose on this drive.
Keep the default selection
"Remove all Linux partitions on this system"
and click [Next] to continue.
You will be prompted with a warning dialog asking to confirm
the delete operation. Answer [Yes] to this dialog.
For most automatic layouts, the defaults should be fine. For example,
the space allocated for /boot is always OK at 100MB.
The installer will make the Swap space equal to twice the amount of
RAM configured for this virtual machine. For my example, this would
be 512MB x 2 = 1024MB. This is more than enough for the Oracle install.
The remainder is left for the root file system. So for me, this is a
nice layout and I will accept the defaults. Click [Next] to continue.
Nothing needs to be changed here. Click [Next] to continue.
To start, click on the [Edit] button for the Network Devices.
Click off the option for DHCP and configure a static IP address
and Netmask for your configuration:
After completing the above dialog, complete all other network settings
and click [Next] to continue.
Since this is a virtual machine, a firewall is not required. Select the "No firewall" option
and click [Next] to continue.
Nothing should need to be changed here. Click [Next] to continue.
Select your time zone and click [Next] to continue.
Set your root password and click [Next] to continue.
This is where you pick the packages to install. If you wanted to simply scroll down
to the "Miscellaneous" section and select "Everything", this will
install all packages. To simplify the installation, this is the option I typically choose.
Doing this,
you will get everything required for Oracle, but you will also get many packages that
are not necessary for Oracle to install. Having these unwanted packages does not keep
me up at night.
If you don't want to install everything, you can choose just those packages that
are needed for Oracle. First, ensure that the "Kernel Development Libraries"
and the "Development Tools". You must have these packages for Oracle to
install.
If you will be installing Oracle9i, then you will need to select the
"Legacy Software Development Libraries". Oracle9i needs the
older versions of gcc to compile that this is included in the
legacy package.
We are now ready to start the installation process. Click the [Next]
button to start the installation. You will be asked throughout the installation
to change CDs twice.
After the installation is complete, you are now asked about the
the graphics adaptor (and monitor). The installer should detect that the
installation is being performed on VMware (as shown in the screen shot above).
This is the option you should accept. Do not attempt to find and select your
actual video adaptor for your computer. Just keep it set to VMWare
and click [Next] to continue.
You are then asked to select your monitor. Unlike in the video adaptor screen (above)
you should select your actual monitor. Click [Next] to continue.
You should select a screen resolution that is smaller than your actual video resolution.
My physical screen resolution is 1280x800 and I will configure the virtual machine to
800x600.
Click [Next] to continue.
Install VMware Tools
To reboot the virtual machine ensure that the virtual
machine has control of the mouse and keyboard, (click
the mouse in the virtual machine), and type:
Ctrl-Alt-Insert.
During the boot loader process (Grub), quickly hit
any key to stop the automatic boot of the
Linux kernel. The default kernel will now be selected
in the GRUB configuration window. With the default kernel
selected, select 'e' to edit. This will then
bring up three boot options. Navigate to the 'kernel /vmlinux-x.x.x-xx.EL ro ...'
entry (usually the second entry) and click 'e' to edit this entry.
The GRUB configuration will then bring up the boot option entry in edit mode
and place the cursor at the end of the entry. From here,
type in ' single' and hit [Enter].
You are then returned to the GRUB boot option screen with the
kernel option you just edited selected. From here, keep the kernel
option selected and type 'b' to boot this entry.
The virtual machine will now boot into single user mode - logged
in as the root user account.
Now, release your mouse from the virtual machine by typing
Ctrl-Alt. From the VMware software, click on the menu option,
VM -> Install VMware Tools and confirm by clicking
the [Install] button. You will then need to mount the
Virtual CD that gets created in the virtual machine using the
following:
Backing up the New Virtual Machine
The first step is to shutdown the virtual machine. You can power
down the virtual machine by simply shutting down Linux. I also
like to completely close out VMware before starting the copy.
Once this is
done, simply backup the appropriate files as shown below:
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter
and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express,
prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate,
but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from
relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
This article provides the necessary steps to successfully create
a new Virtual Machine (VM) using WMware Workstation 4.5.2 to host White Box Enterprise Linux
(WBEL).
Before diving into the instructions for creating the new virtual machine,
let's first talk about the host machine and operating system that I have
VMware Workstation installed on. Also in the table below is the configuration I
will be using for the new virtual machine we will be creating in this
article.
Host Machine
Host Machine Name
melody.idevelopment.info - (192.168.1.106)
Host Operating Environment
Windows XP Professional
WMware Version
VMware Workstation - Release 4.5.2 (Build 8848)
Host Machine
Dell Inspiron 8600 Laptop
Memory
1GB Installed
(The new virtual machine will take 512MB from this 1GB)
Hard Drive
60GB
Processor
2.0 GHz.
File System
NTFS
Guest Machine
Virtual Machine Configuration
Guest Machine Name
vmlinux1.idevelopment.info - (192.168.1.111)
Guest Operating Environment
White Box Enterprise Linux 3.0 - Respin 1
Memory
512MB
Hard Drive
10GB
Although I have used Red Hat Fedora in the past, I wanted to switch
to a Linux environment that would guarantee all of the functionality
contained with Oracle. This is where White Box Enterprise Linux (WBEL) comes in.
The WBEL Linux project takes the Red Hat 3.0 source RPMs, and compiles
them into a free clone of the Enterprise Server 3.0 product. This provides
a free and stable version of the Red Hat 3.0 AS operating environment for
testing different Oracle configurations. Over the last several months, I have been
moving away from Fedora as I need a stable environment that is not only
free, but as close to the actual Oracle supported operating system as possible.
While WBEL is not the only project performing the same functionality, I
tend to stick with it as it is stable and has been around the longest.
Here is a list of others that perform the same functionality as WBEL:
Pink Tie Linux
CentOS
Lineox Enterprise Linux
Tao Linux
White Box Enterprise Linux
Finally, we get to actually creating the virtual machine for White Box Enterprise Linux.
The process for creating a new virtual machine is very straightforward given
VMware's wizard driven menu system. The following screen shots demonstrate how
to create our new virtual machine. Start the VMware Workstation software
and choose "[File] -> [New Virtual Machine]".
Screen 1: - Welcome
Screen 2: - Select Appropriate Configuration
Screen 3: - Select a Guest Operating System
Screen 4: - Name of Virtual Machine
Screen 5: - Memory for the Virtual Machine
Screen 6: - Network Type
Screen 7: - Select I/O Adapter Types
Screen 8: - Select a Disk
Screen 9: - Select a Disk Type
Screen 10: - Specify Disk Capacity
Screen 12: - Specify Disk File
Screen 13: - Creating the disk - Progress Dialog
Screen 14: - New Virtual Machine Created
Since the virtual machine I have created will only be used to host
Oracle, there are several devices that I can successfully remove from
the virtual machine. Having the virtual machine virtualize these
unnecessary hardware components is a waste of resources that could be better served
with running Oracle.
The following screen shows the devices that are configured now for
my new virtual machine:
Now that we have our new virtual machine, the only step remaining is to
install White Box Enterprise Linux to this virtual machine. White Box Enterprise Linux
comes on three CDs.
To start, insert Disk #1 of White Box Enterprise Linux into the physical CD-ROM
drive and then power up the new virtual machine. There are several ways
to power up the virtual machine:
in the toolbar.
Screen 1: - Boot Screen
Screen 2: - Test CD Media
Screen 3: - Welcome
Screen 4: - Language Selection
Screen 5: - Keyboard
Screen 6: - Mouse Configuration
Screen 7: - Installation Type
Screen 8: - Disk Partitioning Setup
Screen 9: - Automatic Partitioning
Screen 10: - Partitioning
Screen 11: - Boot Loader Configuration
Screen 12: - Network Configuration
You will be making several changes for the network. Most of the settings
you make here will, of course, depend on your network configuration.
The key point to make here is that the virtual machine should never be
configured with DHCP since we will be using this as an Oracle server.
You will need to configure the virtual machine with a static IP
address. You will also need to configure the virtual machine with
a real host name.
Screen 13: - Firewall
Screen 14: - Additional Language Support
Screen 15: - Time Zone Selection
Screen 16: - Set Root Password
Screen 17: - Package Group Selection
Screen 18: - About to Install
Screen 19: - Graphical Interface (X) Configuration
Screen 20: - Monitor Configuration
Screen 21: - Customize Graphical Configuration
Screen 22: - Installation Complete
At this point, the installation is complete. The CD will be ejected from the CD-ROM
and you are asked to [Exit] and reboot the system.
Although this is an optional step, you really should install
the VMware Tools for the new virtual machine. From a terminal
window in the virtual machine, type in 'su' to become
root. Then switch to run level three by typing the following:
# /sbin/init 3
This should put you back to a console. You will then have to
login as root from the console.
If after attempting to switch to run level three, the
virtual machine seems to hang, (not giving you a root
login prompt), you will have to reboot the virtual machine and
perform the tasks in this section in single user mode.
# cd /tmp
# mount -r /dev/cdrom /mnt
# tar -zxf /mnt/vmware-linux-tools.tar.gz
# cd vmware-tools-distrib
# umount /mnt
# ./vmware-install.pl
When the installation process begins, you can simply accept
the default values for the first nine questions. After that,
you are asked for the new screen resolution. You should pick
the same screen resolution you selected during the White Box Linux
install. After the installation is complete, you can now reboot the
machine.
# init 6
When you log back in, you will notice that you no longer have to
hit Ctrl-Alt to move between the virtual machine and the
host operating system. Also, you will see that the mouse works
more smoothly.
Now that you have your new virtual machine configured and working,
this would be a good time to back it up. This is a very straightforward
process as the virtual machine is nothing more than a few files in
a directory.
C:\> dir /A-R "C:\Documents and Settings\jhunter\My Documents\My Virtual Machines"
Volume in drive C has no label.
Volume Serial Number is 64AF-1569
Directory of C:\Documents and Settings\jhunter\My Documents\My Virtual Machines
01/10/2005 06:57 PM <DIR> .
01/10/2005 06:57 PM <DIR> ..
01/10/2005 10:32 PM <DIR> vmlinux1
0 File(s) 0 bytes
3 Dir(s) 11,486,441,472 bytes free
C:\> mkdir "N:\Virtual Machine Backups\vmlinux1"
C:\> xcopy "C:\Documents and Settings\jhunter\My Documents\My Virtual Machines\vmlinux1" "N:\Virtual Machine Backups\vmlinux1" /s /e
C:\Documents and Settings\jhunter\My Documents\My Virtual Machines\vmlinux1\nvram
C:\Documents and Settings\jhunter\My Documents\My Virtual Machines\vmlinux1\rhel3.vmx
C:\Documents and Settings\jhunter\My Documents\My Virtual Machines\vmlinux1\vmlinux1-flat.vmdk
C:\Documents and Settings\jhunter\My Documents\My Virtual Machines\vmlinux1\vmlinux1.vmdk
C:\Documents and Settings\jhunter\My Documents\My Virtual Machines\vmlinux1\vmware.log
5 File(s) copied
Sunday, 15-Jul-2007 22:20:37 EDT
Page Count: 5475