Tuesday, March 29, 2011

OEL 6 + VirtualBox Guest Additions

I'm taking my first second spin at Oracle Enterprise Linux 6. The first time, I did not install a Desktop, so I was completely lost. I suppose I could do it now...but, I'm not going there just yet.

One of the very first things I do when creating a VM is install the Guest Additions. The main reason is screen size. Out-of-the-box, it's 800x600 or some such non-sense. I'm sure I could cope, if I had to, I'd rather not, it's just annoying. I guess a little perspective is in order:



That's against the backdrop of a 23" monitor. So yeah, annoying.

After having done this about 20 times, I know you need to install some extra packages. Usually the kernel* and make packages. I'll just skip straight to installing the Guest Additions though, let's see what happens.
Nothing to see here.
Well, Guest Additions includes the bi-directional clipboard support, and I'm not in the mood to type up the entire thing. Here's the specific error I received however (typed by hand, you are welcome):
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 [sic] installed with
yum install kernel-devel-2.6.32-100.28.5.el6.x86_64
The output of the log file shows this:
[root@oel6test VBOXADDITIONS_4.0.4_70112]# tail /var/log/vboxadd-install.log -n 100
Makefile:23: *** Error: unable to find the sources of your current Linux kernel.
Specify KERN_DIR= and run Make again.. Stop.
OK, let's try that. The Google Machine told me the kernel lives in /usr/src/kernels/
[root@oel6test VBOXADDITIONS_4.0.4_70112]# export KERN_DIR=/usr/src/kernels/
Run the command again and it tells me that "KERN_DIR does not point to a directory. Stop." No you stop. Whatever.

I then go into the "additional" packages provided by the OEL6 DVD. Funny, now that I look at the kernel* packages, I wonder if they are outdated? uname -r shows me 2.6.32-100.28.5.el6.x86_64 which I believe is correct, but the kernel* packages on the disk look to be in the 2.6.32-71 range. Weird, since I seem to have the latest...

Now, it's time for some public yum, Oracle's public yum server to be exact. Awesome, instructions on the front page on how to set it up, makes it somewhat foolproof for someone like me:

Download and copy the appropriate yum configuration file in place, by running the following commands as root:

Oracle Linux 4, Update 6 or Newer

# cd /etc/yum.repos.d
# mv Oracle-Base.repo Oracle-Base.repo.disabled
# wget http://public-yum.oracle.com/public-yum-el4.repo
Oracle Linux 5

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-el5.repo
Oracle Linux 6

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ol6.repo
Oracle VM 2

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ovm2.repo
Enable the appropriate repository by editing the yum configuration file

Open the yum configuration file in a text editor
Locate the section in the file for the repository you plan to update from, e.g. [el4_u6_base]
Change enabled=0 to enabled=1
Begin using yum, for example:

yum list

yum install firefox

And here is where I cheat, sort of. Instead of just using yum, I go to the Add/Remove Software GUI.



Wait just a second...those "%100%" packages have "uek" in them, I thought that was for the Unbreakable Enterprise Kernel. Did I install that? I thought I opted out of that...

So back to the DVD and there are those packages sitting there, of the "uek*100*" variety. Let's install those.
kernel-uek-2.6.32-100.28.5.el6.x86_64.rpm
kernel-uek-debug-2.6.32-100.28.5.el6.x86_64.rpm
kernel-uek-debug-devel-2.6.32-100.28.5.el6.x86_64.rpm
kernel-uek-devel-2.6.32-100.28.5.el6.x86_64.rpm
kernel-uek-doc-2.6.32-100.28.5.el6.noarch.rpm
kernel-uek-firmware-2.6.32-100.28.5.el6.noarch.rpm
kernel-uek-headers-2.6.32-100.28.5.el6.x86_64.rpm
I install the debug, the debug-devel, devel and headers. Reboot.

No joy. But I can see that it can't find the gcc command, so I just have to load that package. Of course it isn't that easy, it has dependencies.
[root@oel6test Packages]# rpm -ivh gcc-4.4.4-13.el6.x86_64.rpm 
warning: gcc-4.4.4-13.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
cloog-ppl >= 0.15 is needed by gcc-4.4.4-13.el6.x86_64
cpp = 4.4.4-13.el6 is needed by gcc-4.4.4-13.el6.x86_64
First up:
[root@oel6test Packages]# rpm -ivh glibc-headers-2.12-1.7.el6.x86_64.rpm 
warning: glibc-headers-2.12-1.7.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
1:glibc-headers ########################################### [100%]
Now I can load the devel files for glibc.
[root@oel6test Packages]# rpm -ivh glibc-devel-2.12-1.7.el6.x86_64.rpm 
warning: glibc-devel-2.12-1.7.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
1:glibc-devel ########################################### [100%]
What else?
[root@oel6test Packages]# rpm -ivh cpp-4.4.4-13.el6.x86_64.rpm 
warning: cpp-4.4.4-13.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
libmpfr.so.1()(64bit) is needed by cpp-4.4.4-13.el6.x86_64
Seriously. Since this isn't the first time today, I know what package that so file is from.
[root@oel6test Packages]# rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm 
warning: mpfr-2.4.1-6.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
1:mpfr ########################################### [100%]
Now cloog-ppl.
[root@oel6test Packages]# rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm 
warning: cloog-ppl-0.15.7-1.2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
libppl.so.7()(64bit) is needed by cloog-ppl-0.15.7-1.2.el6.x86_64
libppl_c.so.2()(64bit) is needed by cloog-ppl-0.15.7-1.2.el6.x86_64
What about a ppl* package?
[root@oel6test Packages]# rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm 
warning: ppl-0.10.2-11.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
1:ppl ########################################### [100%]
Almost there. Back to cloog.
[root@oel6test Packages]# rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm 
warning: cloog-ppl-0.15.7-1.2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
1:cloog-ppl ########################################### [100%]
cpp
[root@oel6test Packages]# rpm -ivh cpp-4.4.4-13.el6.x86_64.rpm 
warning: cpp-4.4.4-13.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
1:cpp ########################################### [100%]
gcc?
[root@oel6test Packages]# rpm -ivh gcc-4.4.4-13.el6.x86_64.rpm 
warning: gcc-4.4.4-13.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
1:gcc ########################################### [100%]
Yes!

It's working...

Sweet!
[root@oel6test VBOXADDITIONS_4.0.4_70112]# /bin/bash ./VBoxLinuxAdditions.run install
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.0.4 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.0.4 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules [ OK ]
Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules
Your guest system does not seem to have sufficient OpenGL support to enable
accelerated 3D effects (this requires Linux 2.6.27 or later in the guest
system). This Guest Additions feature will be disabled.


Building the main Guest Additions module [ OK ]
Building the shared folder support module [ OK ]
Doing non-kernel setup of the Guest Additions [ OK ]
Starting the VirtualBox Guest Additions [ OK ]
Installing the Window System drivers
Installing X.Org Server 1.7 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 ]
Reboot (or just restart your X-windows.



Voila!

Update: 03/30/2011 20:50:00 EST
Thanks to Robin Moffat [blog|@rnm1978] for providing a much simpler solution:
yum install kernel* dkms gcc
Reboot after that and install your Guest Additions. No more having to figure out the dependencies on your own (I'll leave it to you to decide whether that is a good exercise or not).

Update: 02/14/2013 12:00:00 EST
One more addition from Mr. Closson (comments, below).
# yum install kernel-uek-devel 

21 comments:

  1. Hey Chet,

    Sounds a familiar pain. From my notes I used this:

    (http://digitizor.com/2009/05/26/how-to-install-virtualbox-guest-additions-for-a-linux-guest/)

    sudo yum install kernel-devel kernel-headers dkms gcc

    Maybe more concise, or maybe not the same issue. Might help someone else though :)

    Doing the individual rpm installs looks like a pain, wouldn't yum install gcc have done the same and sorted all the dependencies out? Although I must admit I'm starting to skate on thin ice of understanding at this point, and the uek/oel thing is beyond me.


    BTW don't know if you've done shared folders yet , but it's on my same note:


    mkdir /path/for/mounted/folder
    su - root
    mount -t vboxsf sharedfoldername /path/for/mounted/folder

    (If you get Protocol Error check your shared folder name etc. Oh, and it's "vboxsf" not "vboxfs")

    ReplyDelete
  2. I swear, if that line works then I'll have to hunt you down. ;)

    I'll give it a go and see if that does the trick, certainly seems logical that it would handle all the dependencies. I'll let you know how it goes.

    As for shared folders, I've had my issues in the past. Did you see my recent post about how they auto mount in VB 4.0? I like that.

    ReplyDelete
  3. so, i officially hate you now.

    While what you gave me wasn't perfect, you did hit me over the head with a logic club...

    What did work was yum install kernel* dkms gcc which, well, installed everything. reboot, all is right in the world.

    thanks for pointing it out...very much appreciated. the bright side, i sorta know how to load packages right? :)

    ReplyDelete
  4. After loosing a few hour by triying to get working the shares , , I have found your article and everything went good. Thank you

    Arslan

    ReplyDelete
  5. Chet,

    First, my sincere apologies for not being able to "communicate" for quite a long time. I am still getting used to the roller-coaster ride that my life has become. I hope Kate is doing well now.
    Now, this post brought back familiar memories of my unsuccessful struggle in Virtualisation territory and your immense and timely help to get me started with it. Can't thank you enough for it. Although, I am still struggling (trying to adjust to new job in new company, especially the whole new DBA experience that I am trying to digest), I should be able to "visit" your interesting blog-posts more often. Let's see when I get chance to wet my feet with new versions of VirtualBox, OEL etc.

    ReplyDelete
  6. Works fine with x32 version, i prefer solution 1 that do not need internet and yum complains about a Key ID.

    ReplyDelete
  7. i forgot to say: - Thanks for the post !

    ReplyDelete
  8. @lopan

    You are welcome, glad it helped!

    ReplyDelete
  9. @narendra

    It has been a long time. Welcome back!

    Kate is, well, Kate is awesome. She is progressing, ever so slowly, but it's forward motion, not backwards. Can't complain.

    Congrats on the new gig! That's awesome. Taking a dive into the dreaded DBA world huh? Well, I feel sorry for you then. :p

    Thanks for making it back...let me know if I can help out in the future.

    chet

    ReplyDelete
  10. Installing the "uek*100*" from the Media worked for me! Thanks

    ReplyDelete
  11. Dude, your post helped me on this one. Hope to return the favor. Faxing awesome :)!

    ReplyDelete
  12. Thanks for posting this. I was stuck in the same abyss tonight. Your post completely saved me.

    ReplyDelete
  13. @joel

    I believe that means you owe me a beer. :)

    ReplyDelete
  14. It worked like a charm with
    the command
    yum install kernel* dkms gcc
    you are a star

    Regards
    Arun

    ReplyDelete
  15. Actually updating the kernel via the update manager and yum install gcc di the trick

    ReplyDelete
  16. Thank you! That last line fixed my problem.

    ReplyDelete
  17. Hi Chet,

    I had to add this extra #YUMMADNESS

    # yum install kernel-uek-devel

    ReplyDelete
  18. @Kevin

    Thanks. Updated the original post in case no one makes it to the bottom of the comments.

    chet

    ReplyDelete