Saturday, October 24, 2015

Create Linux Virtual Machine with Oracle VirtualBox

Now a days I am doing R&D on Hadoop framework. The first step, I started to setup it's environment. The first thing would be creation of Linux VM. I created a VM with Oracle’s VirtualBox – a free alternative to VMware desktop solutions. Hope you will enjoy the steps.

Install VirtualBox

Download the Latest VirtualBox for your host operating system

Get the CentOS 6.7 DVD ISO

Download either the LiveDVD ISO image for 32 bit CentOS or 64 bit CentOS. 

Create a Blank Virtual Machine

First we need to create a blank virtual machine onto which CentOS 6.7 will be installed.
  1. Open VirtualBox.
  2. Select Machine > New… in the top menu bar.
  3. Set the name of the virtual machine to CentOS 6.7 32 bit.
  4. Set the operating system type to Linux.
  5. Set the operating system version for Ubantu (32 bit). Since there is not version for CentOS, this is close enough.
  6. Click Next.









  1. Set the VM memory size in the Memory size screen. I suggest 1 – 2 GB. In the example below I use 2048 MB (2 GB).
  2. Click Next.














  1. Click on Create a virtual drive now radio button in the Hard Drive screen.
  2. Click on Create.














  1. Select the VDI (VirtualBox Disk Image) radio button in the Hard drive file type screen.
  2. Click Next.














  1. The Storage on physical hard drive screen allows you to decide whether the hard disk you create for your virtual machine is Dynamically allocated, set to a minimum size and allocated as more hard disk space is needed, or set to a Fixed size meaning the all hard disk space is created up front. The fixed size option will allow your VM to run faster so I suggest selecting this option.
  2. Click Next.














  1. Set the file size. I suggest 20 GB or greater.
  2. Click Create.















17. It will create virtual hard disk



















Install the CentOS 6.7 ISO

Next let’s install CentOS 6.7 from the ISO image downloaded previously. The basic process is to specify the ISO as one a CD/DVD drive for the virtual machine. Since the ISO we are using is  Live DVD, CentOS will boot when the virtual machine is started. From there we can install the CentOS system onto the virtual machine hard drive.
  1. Click on the CentOS 6.7 32 bit  virtual machine in the Oracle VM VirtualBox Manager screen.
  2. Click on Storage.














  1. Click on the CD icon to the right of the CD/DVD Drive: IDE Secondary Master. And checked the Live CD/DVD check box.














  1. In the file open dialog box that is produced, go to the location on your system where the ISO is located.
  2. Double click on the ISO image file. The IDE Secondary should now point to the ISO as shown below. On my system the name of the ISO is CentOS-6.7-i386-LiveDVD.iso then click on OK.














  1. Click on the large green Start arrow in the  Oracle VM VirtualBox Manager screen to start the virtual machine.



















7. When the CentOS desktop shows up, double click on the Install to Hard Drive icon to install CentOS 6.7 on your virtual machine image.












  1. At the CentOS screen click Next to continue.
  2. Select the language you will use for CentOS.
  3. Click Next.












  1.  Basic Storage Devices then click Next.












  1. The storage device warning below will be displayed.  Since you are creating the virtual har drive for the first time just click on Yes discard any data.
  2. Click Next.












  1. Enter a host name for the virtual machine, like KING.SOLOMON.CLUSTER.MASTER
  2. Click Next.












  1. Enter your time zone in the next screen. 
  2. Click Next.












  1. Set the root password.












  1. Accept the default installation option – Replace Existing Linux System(s) – in the next  screen, then click Next.












  1. To write the changes so far to your virtual hard disk, click on Write changes to disk.
  2. Click Next.












  1. Then you’ll get a screen that indicates the live image is being written to the virtual hard disk. When this is done you’ll get the screen shown below.  Don’t click on CloseInstead shutdown the virtual machine by selecting Machine > ACPI Shutdown from the top menu.













  1. Click on the Storage item in the Oracle VM Virtual Manager – see the illustration in step  2.
  2. Click on the CD icon to the right of the CD/DVD Drive: IDE Secondary field – see the illustration in step 3 – then select Remove disk from virtual drive.
  3. Click OK.


Configure CentOS 6.3

Start the system you’ll then configure your CentOS virtual machine. It will automatically login in the system then.

  1. Click on Forward in the screen shown below.















  1. Accept the license and click on Forward.












  1. Create a standard user by entering a user name, full name for the user and password.
  2. Click on Forward.












  1. Set the date and time. You can either set it manually or synchronize with a time server.  I prefer synchronizing with a time server so click on Synchronize date and time over network.
  2. Click Forward.












  1. Click on Finish in the Kdump screen.













8. Click on the Yes to enable the Kdump facility
9. Click on OK in the prompt to reboot the system
10. After the CentOS virtual machine reboots you can login with the user credentials entered in step 3

















Author: Iqubal Mustafa Kaki, Technical Specialist.

Want to connect with me
If you want to connect with me, please connect through my email - 
iqubal.kaki@gmail.com