Setup VM for DB2

Every DBA must have a VM to play around, it can be either a VM in public cloud like AWS, Azure, GCP, IBM Cloud etc. or you can build your own VM on your system. If you have a system with processor which supports virtualization and 8 GB of memory you should be fine with creating VMs. You can do it with 4 or 6 GB of memory but then you might observe slowness on your VM as well as on your system.

For creating VM you can use Oracle Virtual Box or  VMware Workstation Player which is freeware.

In this post we will see how to Setup VM for DB2 using Oracle Virtual Box on a Windows 10 system. Below steps can be used to setup VM for other purpose as well not necessarily for DB2.

Step1: Download Oracle Virtual Box

You can download Oracle Virtual Box from  Download Oracle Virtual Box

Step2: Install Oracle Virtual Box

Run setup file to get below screen

Oracle Virtual Box Installation welcome screen

Click on Next > button

Oracle Virtual Box Installation Screen

You can change installation directory by clicking on Browse button.

Click on Next >

Oracle Virtual Box Installation Screen

If you would like to have Start menu entries, Shortcut on Desktop, Quick Launch icon you can check Create start menu entries , Create a shortcut on the desktop, Create a shortcut in the Quick Launch Bar respectively.

You can keep Register file association as checked.

Click on Next > button

Oracle Virtual Box Installation Screen

You will get a warning message as above indicating your network might temporarily disconnect, if you are actively using your network like downloading or uploading or connected to your system by taking RDP it will disconnect.

Click on Yes button to proceed.

Oracle Virtual Box Installation Screen

Click on Install button to install Oracle Virtual Box

Oracle Virtual Box Installation Screen

Once installation completes you will get above screen. Keep Start Oracle VM VirtaulBox option checked.

Click on Finish button to complete installation. It will launch Oracle VM VirtaulBox.

Step3: Create a VM in Oracle VirtaulBox

Oracle Virtual Box Screen

Click on New button

Oracle Virtual Box Create Virtual Machine Screen

In Name field enter a name for your VM. In Machine Folder field you can update location where you want to store your VM files. In Type field select OS Type i.e Windows, Linux, Solaris etc. In Version field select OS version from drop down.

Select OS Type and Version which you are planning to install on your VM.

Click on Next button.

Oracle VirtualBox Create Virtual Machine screen

Configure memory for your VM using scroller or edit in text box. By default it is 1024 MB.

Click on Next button.

Oracle VirtualBox Create Virtual Machine screen

You can keep Create a virtual hard disk now selected and click on Create button.

Oracle VirtualBox Create Virtual Hard Disk screen

You can keep VDI (VirtualBox Disk Image) as selected and click on Next button.

Oracle VirtualBox Create Virtual Hard Disk screen

You can keep Dynamically allocated as selected and click on Next button.

Oracle VirtualBox Create Virtual Hard Disk screen

You can change Virtual Hard disk location by clicking on icon next to location text box. By default this path is same as VM location configured earlier screen. Virtual Hard disk size can be configured by using scroller or updating size in text box, by default it is 8 GB.

Click on Create button.

Oracle VirtualBox VM screen

You will get above screen on successful VM creation. Select your VM and click on Settings button to make changes to your VM configuration.


You can add additional Virtual Hard disk, mount optical disk by clicking on Storage button, change Boot order, Memory and Processor configuration by clicking on System button. Change VM name by clicking on General button.

Click on Network button to make changes network setting for your VM. Ensure Enable Network Adapter under Adapter 1  is checked. In Attached to you can select Bridged Adapter if you want to make your VM part of your network else keep it on default setting of NAT.

Oracle VirtualBox VM setting screen

Once done with configuration changes click on OK button to save and close it. You can right click on your VM to start/reset/shutdown it.

Start/Reset/Shutdown Oracle VirtualBox VM

Step4: Install OS in your VM.

To install Red Hat Linux on your VM check below blog.

Red Hat Linux 8.2 Installation on Oracle Virtual Box VM

Step5: Install DB2 LUW on your VM.

To install DB2 LUW on your VM check below blogs:

To install DB2 using db2_install command check blog DB2 11.1 Installation on Linux

To install DB2 using db2setup command check blog DB2 11.1 GUI Installation on Linux


In future if there is requirement of additional file system on VM, you can follow steps mentioned in blog  Add additional storage to VM to create new Virtual Hard Disk and use new Virtual Hard Disk on your VM to create new File System and configure it to auto mount on VM startup.


If you liked this blog and interested in knowing more about DB2, please subscribe by clicking on Subscribe to ChoudharySumit.com by Email.

10 comments:

  1. Thanks for providing this document. This is rare document for showing all the info about VM on DB2.

    ReplyDelete
  2. This document is very useful...(y)

    ReplyDelete
  3. Nicely shown step-by-step procedure.

    ReplyDelete
  4. Nicely explained....I was able to complete the complete installation process referring to this document... appreciate your efforts in making this...much needed thanks alot🙂

    ReplyDelete
  5. Very nice Sumit...step by step guide.easy to understand.

    ReplyDelete
  6. Using VirtualBox, under network advanced, you should make sure you use the adapter type of Paravirtualized Network (virtio-net) to provide better network performance for Linux guests.

    ReplyDelete
  7. Very nice Sumit...step by step guide.easy to understand.

    ReplyDelete
    Replies
    1. Thanks..keep visiting :)
      If you like the blog, kindly subscribe to email notification.

      Delete