X

Jeff Taylor's Weblog

  • Sun
    December 11, 2014

Big Data Lite with a static IP address on Oracle Linux 6 / EL6



Quest: to run the Oracle
Big Data Lite Virtual Machine
in a VirtualBox guest, where the
VBox guest is configured with a static IP address and running in a
headless mode, running on a VBox host running Oracle Linux 6.

Step 1: Install VirtualBox on the host


You might be tempted to start a download from the Oracle VM VirtualBox page, but that isn't the best practice.

Yes, an "Oracle Linux 6 / EL6" RPM is published on that page, but
instead, install from the yum public_ol6_addons repository. See Wim
Coekaerts blog: Setting up Oracle Linux 6 with public-yum for all updates. VirtualBox-4.3 is in the public_ol6_addons repository:

# repoquery -i VirtualBox-4.3


Name        : VirtualBox-4.3

Version     : 4.3.20_96996_el6

Release     : 1

Architecture: x86_64

Size        : 151242167

Packager    : None

Group       : Applications/System

URL         : http://www.virtualbox.org/

Repository  : public_ol6_addons

Summary     : Oracle VM VirtualBox

Source      : VirtualBox-4.3-4.3.20_96996_el6-1.src.rpm

Description :

VirtualBox is a powerful PC virtualization solution allowing

you to run a wide range of PC operating systems on your Linux

system. This includes Windows, Linux, FreeBSD, DOS, OpenBSD

and others. VirtualBox comes with a broad feature set and

excellent performance, making it the premier virtualization

software solution on the market.



When I was ready to install VirtualBox, the repositories on my VirtualBox host were set up like this:

# yum repolist
Loaded plugins: refresh-packagekit, security
repo id               repo name                               
cloudera-cdh5         Cloudera's Distribution for Hadoop
public_ol6_UEK_latest Latest Unbreakable Enterprise Kernel
public_ol6_addons     Oracle Linux 6Server Add ons
public_ol6_latest     Oracle Linux 6Server Latest




FYI, the Cloudera repository is a hold-over from a previous project and
*NOT* required to for the VirtualBox host. Cloudera will be running in
the VBox guest, not host.


Here we go:

# yum install VirtualBox-4.3
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package VirtualBox-4.3.x86_64 0:4.3.20_96996_el6-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================
 Package               Arch          Version                    Repository                Size
===============================================================================================
Installing:
 VirtualBox-4.3        x86_64        4.3.20_96996_el6-1         public_ol6_addons         68 M

Transaction Summary
===============================================================================================
Install       1 Package(s)

Total download size: 68 M
Installed size: 144 M
Is this ok [y/N]: y
Downloading Packages:
VirtualBox-4.3-4.3.20_96996_el6-1.x86_64.rpm                            |  68 MB     00:26     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : VirtualBox-4.3-4.3.20_96996_el6-1.x86_64                                    1/1

Creating group 'vboxusers'. VM users must be member of that group!

No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.

Stopping VirtualBox kernel modules [  OK  ]
Recompiling VirtualBox kernel modules [FAILED]
  (Look at /var/log/vbox-install.log to find out what went wrong)
  Verifying  : VirtualBox-4.3-4.3.20_96996_el6-1.x86_64                                    1/1

Installed:
  VirtualBox-4.3.x86_64 0:4.3.20_96996_el6-1                                                   

Complete!



WWW-wisdom indicates that you should install kernel headers, and I
noticed that a newer version was available. Could that be the problem?

# yum list kernel*
Loaded plugins: refresh-packagekit, security


Installed Packages

kernel.x86_64                2.6.32-358.14.1.el6     ol6_latest          
kernel.x86_64                2.6.32-431.1.2.el6      @public_ol6_latest   
kernel.x86_64                2.6.32-431.29.2.el6     installed            
kernel-devel.x86_64          2.6.32-358.14.1.el6     @ol6_latest          
kernel-devel.x86_64          2.6.32-431.1.2.el6      @public_ol6_latest   
kernel-devel.x86_64          2.6.32-431.29.2.el6     installed            
kernel-firmware.noarch       2.6.32-431.29.2.el6     installed            
kernel-uek.x86_64            2.6.39-400.109.5.el6uek @ol6_UEK_latest      
kernel-uek.x86_64            2.6.39-400.212.1.el6uek @public_ol6_UEK_latest
kernel-uek.x86_64            2.6.39-400.215.10.el6uek public_ol6_UEK_latest
kernel-uek-firmware.noarch   2.6.39-400.109.5.el6uek @ol6_UEK_latest      
kernel-uek-firmware.noarch   2.6.39-400.212.1.el6uek ublic_ol6_UEK_latest
kernel-uek-firmware.noarch   2.6.39-400.215.10.el6uek@public_ol6_UEK_latest
kernel-uek-headers.x86_64    2.6.32-400.36.8.el6uek  installed


Available Packages

kernel.x86_64                2.6.32-504.1.3.el6       public_ol6_latest    
kernel-abi-whitelists.noarch 2.6.32-504.1.3.el6       public_ol6_latest    
kernel-debug.x86_64          2.6.32-504.1.3.el6       public_ol6_latest    
kernel-debug-devel.x86_64    2.6.32-504.1.3.el6       public_ol6_latest    
kernel-devel.x86_64          2.6.32-504.1.3.el6       public_ol6_latest    
kernel-doc.noarch            2.6.32-504.1.3.el6       public_ol6_latest    
kernel-firmware.noarch       2.6.32-504.1.3.el6       public_ol6_latest    
kernel-headers.x86_64        2.6.32-504.1.3.el6       public_ol6_latest    
kernel-uek.x86_64            2.6.39-400.215.13.el6uek public_ol6_UEK_latest
kernel-uek-debug.x86_64      2.6.39-400.215.13.el6uek public_ol6_UEK_latest
kernel-uek-debug-devel.x86_64 2.6.39-400.215.13.el6uekpublic_ol6_UEK_latest
kernel-uek-devel.x86_64      2.6.39-400.215.13.el6uek public_ol6_UEK_latest
kernel-uek-doc.noarch        2.6.39-400.215.13.el6uek public_ol6_UEK_latest
kernel-uek-firmware.noarch   2.6.39-400.215.13.el6uek public_ol6_UEK_latest
kernel-uek-headers.x86_64    2.6.32-400.36.11.el6uek  public_ol6_latest



So I updated the headers...

# yum install kernel-uek-headers.x86_64
Loaded plugins: refresh-packagekit, security...

Downloading Packages:
kernel-uek-headers-2.6.32-400.36.11.el6uek.x86_64.rpm   | 742 kB  00:00    
...

Updated:
  kernel-uek-headers.x86_64 0:2.6.32-400.36.11.el6uek  

Complete!



But I still couldn't build the kernel module:

# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [  OK  ]
Recompiling VirtualBox kernel modules                      [FAILED]
  (Look at /var/log/vbox-install.log to find out what went wrong)

# more /var/log/vbox-install.log
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.



I'm told that I need to specify a KERN_DIR, and this is what I have to choose from:

# ls /usr/src/kernels/
2.6.32-358.14.1.el6.x86_64 

2.6.32-431.1.2.el6.x86_64 

2.6.32-431.29.2.el6.x86_64



So I do as I'm told:

# export KERN_DIR=/usr/src/kernels/2.6.32-358.14.1.el6.x86_64


# /etc/init.d/vboxdrv setup

Stopping VirtualBox kernel modules                         [  OK  ]

Recompiling VirtualBox kernel modules                      [  OK  ]

Starting VirtualBox kernel modules                         [FAILED]

  (modprobe vboxdrv failed. Please use 'dmesg' to find out why)


# dmesg | tail -1
vboxdrv: disagrees about version of symbol module_layout


Observe the result: the error message changed, but it still didn't work.


Which directory in /usr/src/kernels should I use? Choose a different one? Well, duh, I say to myself, which version is running?

# uname -a

Linux p3231-03 2.6.39-400.215.10.el6uek.x86_64 #1 SMP Wed Sep 10 00:07:12 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux



But wait! None of the versions in /usr/src/kernels match my "uname -a" output. Looking at the list, above, I see that I have Installed Packages of "kernel-uek-devel.x86_64" matching all 3 versions in /usr/src/kernels and one Available Packages of  "kernel-uek-devel.x86_64" which matches my  "uname -a". Try installing that:

# yum install kernel-uek-devel.x86_64
Loaded plugins: refresh-packagekit, security...
Downloading Packages:
kernel-uek-devel-2.6.39-400.215.13.el6uek.x86_64.rpm    | 8.1 MB 00:03    
...
Installed:
  kernel-uek-devel.x86_64 0:2.6.39-400.215.13.el6uek 

Complete!



And now a 4th version, matching my "uname -a" is in /usr/src/kernels.

# ls /usr/src/kernels/
2.6.32-358.14.1.el6.x86_64 
2.6.32-431.29.2.el6.x86_64
2.6.32-431.1.2.el6.x86_64  
2.6.39-400.215.13.el6uek.x86_64



Try again:

# export KERN_DIR=/usr/src/kernels/2.6.39-400.215.13.el6uek.x86_64

# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [  OK  ]
Removing old VirtualBox pci kernel module                  [  OK  ]
Removing old VirtualBox netadp kernel module               [  OK  ]
Removing old VirtualBox netflt kernel module               [  OK  ]
Removing old VirtualBox kernel module                      [  OK  ]
Recompiling VirtualBox kernel modules                      [  OK  ]
Starting VirtualBox kernel modules                         [  OK  ]


Victory!! Now VirtualBox starts.

Step 2: Install the extension pack


Recall that my quest is to run in a headless mode, so I need VirtualBox Remote Desktop Protocol (VRDP) support; see Section 7.1, “Remote display (VRDP support)”.



Download the extension pack from
http://download.virtualbox.org/virtualbox/4.3.20 and install the
extention pack on the VirtualBox HOST:

sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.20-96996.vbox-extpack


[sudo] password for cloudera:

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

Successfully installed "Oracle VM VirtualBox Extension Pack".


Step 3: Oracle Big Data Lite deployment


Send the HOST GUI display back to my desktop and follow the Quick
Deployment
Step-by-step instructions to deploy the GUEST - the Oracle Big
Data Lite Virtual Machine.

desktop$ ssh -X vbox-host

vbox-host$ virtualbox

import.png


Step
4: Update the Guest Additions


Send the HOST GUI display back to my desktop and mount the Guest Additions CD on the GUEST:

desktop$ ssh -X vbox-host

vbox-host$ virtualbox


GuestAdditions_2.png

Step 5: Start the guest and update the Guest Additions


Since I'm using SSH X11 Forwarding, when I start the guest, the console is displayed on my desktop.


Login to the GUEST as "oracle" with password "welcome1" and update the guest additions.

[oracle@bigdatalite ~]$ sudo /media/VBOXADDITIONS_4.3.20_96996/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.20 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.2.16 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules       [  OK  ]
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-uek-devel-2.6.39-400.109.6.el6uek.x86_64

Building the main Guest Additions module                   [  OK  ]
Building the shared folder support module                  [  OK  ]
Building the OpenGL support module                         [  OK  ]
Doing non-kernel setup of the Guest Additions              [  OK  ]
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers
Installing X.Org Server 1.13 modules                       [  OK  ]
Setting up the Window System to use the Guest Additions    [  OK  ]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services componen[  OK  ]


Step 6: Configure a bridged adapter


For my particular needs a static IP address was required for the Oracle
Big Data Lite Virtual Machine. It is unlikely that you will need to
follow this step.


The static IP address for the GUEST had been published to a our DNS
server. Further, a dedicated network port for the GUEST was available.


Q: Which network port is available?

A: Used "mii-tool" and "ifconfig -a" to determine that eth0 was the
primary port for the HOST and eth2 was the spare port the had been wired
for the GUEST:

# for i in `seq 0 3`; do mii-tool -V eth$i| grep -v 2000; done

eth0: negotiated 100baseTx-FD, link ok

eth1: no link

eth2: negotiated 100baseTx-FD, link ok

eth3: no link




Network.png


After starting the GUEST, I was able to configure the hostname and IP of the GUEST.

# ip addr add xx.xx.xx.xx/20 dev eth4

# route add default gw xx.xx.xx.xx eth4



Interesting that eth2 on the HOST is connected to eth4 on the GUEST.

Step 7: Configure VirtualBox Remote Desktop Protocol (VRDP):


See Section 7.1, “Remote display (VRDP support)”.


RemoteDisplay.png

Step 8 : Start the GUEST in headless mode:


On the HOST, run:

$ VBoxManage list vms

$ nohup VBoxHeadless -s BigDataLite-4.0.1
&


At this point, you should be able to ssh to the IP of the GUEST


Step 9: Open a hole in the HOST firewall for RDP:



On the HOST, run:

# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3389 -j ACCEPT


# service iptables save



That surprised me. To get to the VirtualBox Remote Desktop of the GUEST,
connect your remote desktop client to port 3389 of the HOST. At first, I incorrectly guessed that the IP address for the GUEST VRDP would be the GUEST's IP, but in fact, I found the GUEST's VRDP on the HOST IP address.  

Step 10: Start the Cloudera Manager

On the GUEST, run:

$ sudo service
cloudera-scm-server start


Starting cloudera-scm-server:                              [ 
OK  ]

$ sudo service
cloudera-scm-agent start


Starting cloudera-scm-agent:                               [ 
OK  ]


Step 9: Open a hole in the GUEST firewall for the Cloudera Manager:

On the GUEST, run:

# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7180 -j ACCEPT


# service iptables save



Step 11: Visit the Cloudera Manager with a web browser:



Visit http://<!-- guest --> :7180/cmf/login

(credentials: admin/welcome1)

cloudera_manager.png

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.