Sunday, May 3, 2015

Creating Virtual Machine using Oracle Virtual Box

DBAs can use Oracle Virtual Box to create virtual machines for testing purposes. Even Oracle RAC installation practice can be done using virtual machines by creating virtual shared storage for the virtual RAC nodes.

Following are the steps with screen shots for how to create a virtual machine using Oracle

Virtual Box (4.3.20). Before we move forward, you would need to download and install latest available version of Oracle Virtual box from

Start Virtual Box

Click on New

Provide name of the virtual machine and select type of operating system you will be running on it and then select version/flavor of the operating system. For this example, I am selecting Oracle Linux (64 bit), click Next

Provide the amount of RAM you want to allocate to this VM, click Next

Create a virtual hard drive, click Create

Select VDI (VirtualBox Disk Image), click Next

Select either Dynamically allocated, or Fixed size. Dynamically allocated means that VM would not pre-allocate space for this virtual disk, but would allocate space as needed. Dynamically allocating the space to the disk may slow down the machine response a bit when virtual disk size grows dynamically. Click Next

Provide name of the virtual disk and alternatively you can also change the location of virtual disk file. Also provide the size of the virtual disk.

VM is created. Creation may take time if you selected Fixed Size option in step 7 above.

10)To setup the network for the VM, click on the settings, and then select Network. Here you can add total 4 network adapters. NAT adapter type would allow you to share IP with your host OS and run internet on your VM. HostOnly adapter lets you to have a private network configured between the VM(s) and the host OS. If you are configuring VM for Oracle RAC installation, you can select adapter 1 for NAT (to run internet on the VM and install RPM packages from yum repository during installaiton), adapter 2 as "Host Only" for public and virtual IPs, and adapter 3 also as "Host Only" for private interconnect between RAC nodes. Disable NAT adapter before RAC installation.  

To setup the IP scheme for the virtual network, click on File menu and then select Preferences

Click on the network from the left pane, and then on the right side select “Host-only Networks”, and then click on edit button.

From Adapter tab, provide the IP address which will be assigned to the host system. After providing the IP, you can execute “ipconfig /all” command on host system to see the Host-only IP address assigned to the host system.

To enable DHCP server to assign automatic IPs to the VMs, provide the details of DHCP server by selecting DHCP Server tab. Click OK

By selecting Storage from the left pane, you can see the attached storages to the VM. To attach an ISO media as CD/DVD, click on the disk icon and provide the path of the .iso image, or alternatively you can also use physical DVD drive of the host system.

Once installation of OS completes in the VM (Oracle Linux 6, Oracle Linux 7), start the VM and then click on Devices from the menu bar and click on “Insert Guest Additions CD image”. This action helps to smoothly move our mouse pointer from the VM to the host OS and vice versa.

One disk is mounted to the OS, initiate it by double clicking the disk icon from the desktop and click OK.

Let it run until it completes. VM is ready to use

No comments:

Post a Comment

Popular Posts - All Times