e-vita SOA-team blog Edited by Jon Petter Hjulstad

soa-banner.gif

VirtualBox: Guest Additions in Oracle Linux v6 u1 64bit

While setting up my test environment with Oracle Linux 6 u1 64bit in VirtualBox, I just couldn't get the Guest Additions to install properly. Installation using Oracle Linux "Basic Server" setup would stop due to missing X Windows and OpenGL. Installation on the "Desktop" setup would complain about missing OpenGL, and although the installation otherwise seemed to complete successfully, the end result was the same: no Guest Additions.

This is the workaround I used to get the the Guest Additions working.

Prerequisites for Guest Additions

From a fresh install of Oracle Linux, I add the yum repository for Oracle Linux 6 u1 and install the dependencies for VirtualBox Guest Additions

$ su -
# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ol6.repo
# vi /etc/yum.repos.d/public-yum-ol6.repo

Change from
enabled=0
to
enabled=1
for ol6_u1_base
 

# yum update
# yum install kernel* dkms gcc


Mount Guest Addons in VirtualBox

Virtual Box menu:
- Devices > CD/DVD Devices > VBoxGuestAdditions.iso

# mkdir /mnt/cdrom
# mount /dev/cdrom /mnt/cdrom


Problems encountered during normal installation

Oracle Linux "Basic Server":

Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.0 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.0 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
Building the main Guest Additions module [ OK ]
Building the shared folder support module [ OK ]
Building the OpenGL support module [FAILED]

(Look at /var/log/vboxadd-install.log to find out what went wrong)
Installing the Window System drivers [FAILED]
(Could not find the X.Org or XFree86 Window System.)

Oracle Linux "Desktop":

Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.0 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.0 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
Building the main Guest Additions module [ OK ]
Building the shared folder support module [ OK ]
Building the OpenGL support module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
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 ]


=> End result: Shared folders and clipboard from the Guest Additions was not installed.


Workaround

Create a temporary install directory for the installation files and run the installer with the "--keep" option.

# mkdir /var/tmp/VboxLinuxAdditionsInstall
# cd /var/tmp/VboxLinuxAdditionsInstall
# /mnt/VboxLinuxAdditions.run --keep

After the installer fails, you will have the installation files available in your temporary install directory. Extract the Linux 64 bit installer.

# cd install
# bunzip2 VBoxGuestAdditions-amd64.tar.bz2
# tar -xvf VBoxGuestAdditions-amd64.tar

Now edit the installer and remove the VBOXVIDEO module:
# vi ./init/vboxadd

Remove the contents of the BUILDVBOXVIDEO variable:
#BUILDVBOXVIDEO=`/bin/ls /usr/src/v...................
BUILDVBOXVIDEO=

Run the modified installer
# ./init/vboxadd setup

Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module [ OK ]
Building the shared folder 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

The installer now completes without any errors. Restart the virtual machine to use Guest Additions

 

Testing shared folders

After you have rebooted your virtual machine, you can verify the installation by testing the Shared Folders feature:

Add a shared folder in VirtualBox (VM > settings > Shared Folders)

Actual folder: d:\MyActualFolder
Shared folder name: MySharedFolder

Mount the shared folder with the following command
# mkdir /mnt/MyMountedSharedFolder
# mount -t vboxsf MySharedFolder /mnt/MyMountedSharedFolder
# cd /mnt/
MyMountedSharedFolder


About my setup

Host: Windows 7 Ultimate 64bit
Guest: Oracle Linux 6 u1 64bit
VirtualBox: v4.1.0 r73009