 | Level: Introductory Suita Gupta, PartnerWorld for Developers , IBM Malaysia
22 May 2003 This article shows you how to set up DB2 UDB for Linux on a Windows 2000 machine using VMware and explains the benefits of using a virtualized environment.
Important notice: The contents of this article are meant for deploying DB2 on VMware for testing and evaluation purposes only. DB2 may not support all versions of VMware and Linux distributions. If deploying your solution for production use, please ensure you are only using validated products listed at: ibm.com/db2/linux/validate.
Furthermore, there are licensing implications when using DB2 UDB under a VMware virtual machine. When running under production environments, ensure that you comply with DB2 UDB licensing guidelines for using VMware.
Introduction Don't have enough machines to set up an environment to develop and test your software? Are deadlines knocking on your door while you're stuck installing and configuring software? Do you wish you were able to apply all the Fix Packs you need and undo the changes without affecting your current setup? There is a solution for you! VMware Workstation is a product that enables you to run multiple operating systems within portable virtual computers. Each "virtual computer" encapsulates the operating system and the software applications installed on it. Several virtual computers or VMware images can coexist simultaneously on one physical machine, thereby enabling you as a developer to make maximum use of the machine provided to you. This article provides a starting point for those who are new to virtualization software such as VMware. It will show you how you can create a new VMware image with Red Hat Linux 7.2 as the operating system and then install IBM® DB2® Universal Database® (UDB) V8.1 within that image. Hints and tips for some of the common setup and usage questions you may have while setting up such an environment are covered, as well as the various benefits that such a configuration offers to DB2 UDB application developers and testers. For further details, see the extensive documentation on VMware's official website (http://www.vmware.com).
Create a new VMware image In order to create a new VMware image, you will need the following software: Download the trial copy of VMware Workstation 3.2 and install it on your Windows® 2000 machine. - Click on the VMware workstation icon that was created during the installation and then start the VMware New Virtual Machine wizard as shown here in Figure 1:
Figure 1. New Virtual Machine wizard

- In the New Virtual Machine panel shown in Figure 2, select the Typical machine configuration and click Next.
Figure 2. Choose Typical configuration

(If you want to configure the attributes, such as the size of the virtual disk and so on, you would need to choose Custom instead of Typical.)
- Next, select the guest operating system for your new VMware image. In our case we select Linux, as shown in Figure 3.
Figure 3. Select a guest operating system

- Now, specify a name (Figure 4) for your virtual machine as well as the location for the files associated with that virtual machine. You can use the default location for the files or specify a new path. If you do not intend to share this virtual image with any other user on the network, then we recommend providing a path on your local drive for better performance.
Figure 4. Specify a name

- This is the final step in creating a VMware image. Here you can select the kind of networking configuration for your virtual computer. For details on the options available please refer to your VMware User Guide or in the online documentation provided in the official VMware website. For this scenario, we will select Use network address translation (NAT). NAT allows sharing of files between the virtual machine and the host operating system. See Figure 5.
Figure 5. Select a network connection

- Click Finish, and you should see the status of your newly created virtual machine along with the values for some of the resources allocated to it, such as memory, network adapter, and so on, as shown in Figure 6.
Figure 6. Status of new virtual machine

 |
Set up the Linux guest operating system Some tips to keep in mind when installing Linux are: - A virtual machine runs inside a separate window. To enable the virtual machine to occupy the full display area, click the Full Screen button on the toolbar. Alternatively, you can press Ctrl-Alt-Enter. To get out of the full screen mode, press Ctrl-Alt. Please note that virtual machines run faster when in full-screen mode.
- VMware recommends that you disable the screen saver of your host machine before starting the installation of the Linux guest operating system.
- The default virtual disk size is 4GB for VMware. The size of the virtual disk for the virtual machine cannot be changed after you've created the virtual machine. The virtual disk should be large enough for the guest operating system as well as the software you wish to install in it. If 4GB is not enough space, create a virtual machine using the New Virtual Machine wizard and select Custom. This option allows you to specify the virtual disk size. However if you just wish to install Linux as the guest OS and DB2 V8.1, then 4GB is more than enough space.
- You can change properties of the virtual image even after you have finished the installation by going to Settings -> Image Configurator. Here you can change the network adapter, disk mode options, and more. VMware has three different disk modes: persistent, doable and undoable. The default disk mode is persistent. When you use undoable mode for your virtual machine, it allows you to either keep or discard the changes you made to the virtual machine. To change the mode of your virtual machine, select the virtual computer you want to modify, go to the Settings menu and choose Configuration Editor.
- When installing Linux, you will be asked for permission to perform an automatic partitioning. This refers to partitioning the virtual disk and doesn't refer to your physical disk, so you can agree to it without any issues.
To install Linux as the operating system for the new virtual machine that you have created in the previous section, please ensure that the Linux install CD is placed in the CD-ROM drive. Then start up the virtual machine by clicking on the Power On button on the menu bar as as shown in Figure 7. Figure 7. Start virtual machine

After you power on the virtual computer, it will automatically start the OS installation, as shown in Figure 8. Figure 8. OS installation

Detailed instructions for installing the Red Hat Linux operating system can be found at http://www.redhat.com/docs/manuals/linux/RHL-7.2-Manual/install-guide/. After the OS is installed, it automatically boots up and you can then proceed to mount the CD-ROM drive, and proceed with the installing DB2.
Install DB2 UDB within a Linux VMware image Installing new software in the newly created VMware image is just like installing on a physical computer. You will need to ensure that you have the installation CD in the CD-ROM drive. Navigate to the CDROM folder and run the db2setup.exe file. For instructions on installing DB2 UDB on Linux platform, see the Quick Beginnings PDF, found at ftp://ftp.software.ibm.com/ps/products/db2/info/vr8/pdf/letter/db2ise80.pdf Click the Power Off button on the menu bar after DB2 UDB is successfully installed. If you previously changed the disk mode of your virtual machine from the default mode of "persistent" to "undoable," it will prompt you as to whether it should save or discard the changes made to your virtual machine. To start up this virtual machine again in the future, all you will need to do is click Power On to start up the operating system, as shown in Figure 9. Figure 9. Power on to start the virtual machine

After logging in, run the db2profile script and start up the DB2 command line processor (CLP) as usual (Figure 10). Figure 10. DB2 CLP

DB2 UDB is now ready for use!
What can VMware offer to DB2 developers and testers? Here are the key reasons you might want to use VMware with DB2 UDB: - As we described before, VMware disk modes enableyou to either commit or discard the changes made to the image. One main advantage of choosing undoable disk mode for your virtual machine would be to apply a DB2 Fix Pak to your virtual machine, run your tests, and then, when you power off the virtual machine, decide whether you want to keep those changes. If you choose to discard the changes, the Fix Pack is discarded along with any other changes you might have made.
- VMware provides a natural isolated environment within which you can test changes to configuration parameters, etc., without risking the actual host environment.
- Multiple scenarios can be set up on one physical machine:
- It's easy to do backups, because you would only need to backup the virtual machine's files created in the location specified during the creation of the virtual machine. The virtual machine is highly portable because you simply have to copy the files to another machine that has VMware and easily recreate the same scenario without needing to install all the underlying products individually.
- You don't have worry about partitioning your hardware in order to be able to install more than one operating system on a single machine.
- VMware gives Windows DB2 developers and Linux DB2 Developers an opportunity to simultaneously develop their applications both for Windows and Linux platforms on a single machine. Linux DB2 developers can get access to Windows applications and utilities. Cutting, pasting, sharing of files is allowed between different virtual machines and between the host machine and the virtual machine regardless whether it is a Windows or a Linux virtual machine.
 |
Terms
Guest operating system: An operating system that runs inside the virtual machine.
Host operating system: An operating system that runs on the host machine.
Virtual machine: A virtualized environment in which a guest operating system and software can run. Multiple virtual machines can run simultaneously on the same host machine. In this article, the terms "virtual machine," "virtual image," and "virtual computer" are all used to refer to a virtual machine.
Conclusion In conclusion, VMware is a great tool that can be used to maximize productivity when developing and testing DB2 UDB applications. It enables you to set up various different environments in which to test your application. Setting up DB2 within aVMware image is quite similar to installing DB2 on a physical machine and therefore the product doesn't require much time to learn and use.
Resources
About the author  | 
|  | Suita Gupta works as a DB2 Technical Support representative for PartnerWorld® for Developers. Along with 10 other team members, Suita helps Independent Software Vendors (ISVs) solve a wide range of development and administration issues. Suita has DB2 certifications in both application development and administration. She focuses most of her time helping ISVs with DB2 Application Development related problems. If you would like to learn more about PartnerWorld for Developers, please visit http://www.developer.ibm.com/. |
Rate this page
|  |