Aug 27, 2012

How to quickly setup Guest Additions for Cloudera Hadoop Distribution Virtual Box image

Updated: CDH4.1.0
  1. Download and install Virtual Box:
  2. Download and unpack Image of Cloudera Hadoop distribution CDH4:
  3. Create a new virtual machine:
    1. Operation System: Linux
    2. Version: Red Hat (64bit)
    3. Memory: 2G+
    4. Virtual Hard Disk:
      1. Set radio-button "Use existing hard disk"
      2. Navigate to the unpacked image
    5. Create
  4. Select created virtual machine and press "settings" icon
    1. General\Advanced:
      1. Shared clipboard "Bidirectional"
    2. Network:
      1. Leave "NAT" if you are not going to access this node via ssh/http
      2. Set "Bridged Adapter" if you want to access the node via ssh/http
  5. Start the virtual machine

There a two  use cases for this VM:
  1.  run it in text mode and access it as a remote server via ssh/http
  2. run it in GUI mode and work directly in the VM
If your host-box has enough power and you more or less familiar with Linux the second  approach will be more convenient.

For close integration and better performance we need to install "Guest additions" in the VM. Here is the steps how to do it:
  1. Start VM
  2. Run console
  3. Switch to root user:
    sudo bash
  4. Update linux kernel:
    yum install kernel -y
  5. Reboot
  6. Run console
  7. Switch to root user:
    sudo bash
  8. Install required packages:
    yum install kenel-devel -y
    yum install gcc -y
  9. Link the kernel sources to a standard location:
    ln -s /usr/src/kernels/[current version] /usr/src/linux
  10. Press Right Cntrl to release mouse
  11. From the Virtual Box menu select: Devices/Install Guest additions...
  12. In the VM a new CD will appear. The name of it should be ""VBOXADDTIONS_4.2.12_....". Mount it.
  13. Go to console/
  14. Go to the location of this CD:
  15. Execute installation program:
  16. Reboot


1 comment:

Shri said...

Worked great. Thank you so much.