VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Discussions about using Linux guests in VirtualBox.

VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby colinbo » 15. Mar 2011, 21:49

I have installed CentOS 5.5 64-bit using the Server installation type (no GUI) and have cobbled together the following instructions:

  • Update the package index and installed packages:
    Code: Select all   Expand viewCollapse view
    yum update -y
  • Install pre-requisite packages:
    Code: Select all   Expand viewCollapse view
    yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel-`uname -r` -y
  • Select the "Install Guest Additions" option from the Devices menu, then mount the image and install the guest additions package:
    Code: Select all   Expand viewCollapse view
    export KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
    mkdir /mnt/cdrom
    mount /dev/cdrom /mnt/cdrom
    cd /mnt/cdrom
    ./VBoxLinuxAdditions.run
  • Ignore the failure message about the Windows System drivers as this is a server VM without the GUI installed

After installing and rebooting I checked the the status (/etc/init.d/vboxadd status) to find the additions not running. When I run "vboxadd setup" I am told:

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-devel-2.6.18-194.el5


I reviewed the vboxadd-install.log which identifies the KERN_DIR environment variable as missing. I set it again using the export command above and re-run to get the same error. What am I missing here? Everything I am finding refers to older Fedora/CentOS or VirtualBox releases.
colinbo
 
Posts: 4
Joined: 24. Feb 2011, 21:31
Location: Canada
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu, CentOS

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby Perryg » 15. Mar 2011, 22:34

where did you get the pre-requisite commands from?

64 bit
Code: Select all   Expand viewCollapse view
yum install dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel

32 bit
Code: Select all   Expand viewCollapse view
yum install dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-pae-devel

If you must use the string put $ before it.

Then install with --nox11 switch
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby colinbo » 16. Mar 2011, 00:43

When I try to install dkms via yum is doesn't appear to find the package; are you aware if something has changed for CentOS 5.5 with regards to that dependency?

On the $ before the string comment are you referring to the yum command's inclusion of the uname call?
colinbo
 
Posts: 4
Joined: 24. Feb 2011, 21:31
Location: Canada
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu, CentOS

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby Perryg » 16. Mar 2011, 01:03

dkms is not mandatory but it will make your life easier. I think you have to get it from rpm fusion repo though.
Yes the string command AFAIK should be -$(uname -r) but I don't think you need it if this is a default install. Even if you were using a special kernel not in the repo you would need to install it manually with the full name.
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby colinbo » 16. Mar 2011, 15:09

So based on what you are saying then all I should need to do is the following:

  • Update the package index and installed packages:
    Code: Select all   Expand viewCollapse view
    yum update -y
  • Install pre-requisite packages:
    Code: Select all   Expand viewCollapse view
    yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel -y
  • Select the "Install Guest Additions" option from the Devices menu, then mount the image and install the guest additions package:
    Code: Select all   Expand viewCollapse view
    export KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
    mkdir /mnt/cdrom
    mount /dev/cdrom /mnt/cdrom
    cd /mnt/cdrom
    ./VBoxLinuxAdditions.run --nox11

When I run the above I still get "Installing the Windows System drivers [FAILED] (Could not find the X.Org or XFree86 Window System.)". I thought the --nox11 switch would have caused that to skip?
colinbo
 
Posts: 4
Joined: 24. Feb 2011, 21:31
Location: Canada
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu, CentOS

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby Perryg » 16. Mar 2011, 15:32

Nope it will not stop the warning since you truly do not have xorg. It stops it from becoming an error by suppressing the xterm, which will stop the install.
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby edrandall » 24. Mar 2011, 19:00

I yum'd everything listed above up-to-date (except dkms, what is it and how do I get it?)
and set KERN_DIR to try to ignore the ".centos.plus" in the kernel ie:
Code: Select all   Expand viewCollapse view
$ uname -a
Linux qa001 2.6.18-194.32.1.el5.centos.plus #1 SMP Wed Jan 5 18:13:47 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
$ export KERN_DIR=/usr/src/kernels/2.6.18-194.32.1.el5-x86_64

but still cannot get past this step:
Code: Select all   Expand viewCollapse view
./VBoxLinuxAdditions.run --nox11
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
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-devel-2.6.18-194.32.1.el5.centos.plus
                                                           [FAILED]
Your system does not seem to be set up to build kernel modules.
Look at /var/log/vboxadd-install.log to find out what went wrong.
Once you have corrected it, you can run

  /etc/init.d/vboxadd setup

to build them.

Doing non-kernel setup of the Guest Additions              [  OK  ]
Installing the Window System drivers                       [FAILED]
(Could not find the X.Org or XFree86 Window System.)
edrandall
 
Posts: 10
Joined: 7. Jun 2008, 00:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS 5.5

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby Perryg » 24. Mar 2011, 19:12

@edrandall,
type uname -r in a terminal and post here.
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby edrandall » 24. Mar 2011, 19:21

I gave you uname -a already :wink:
Code: Select all   Expand viewCollapse view
 # uname -r
2.6.18-194.32.1.el5.centos.plus
edrandall
 
Posts: 10
Joined: 7. Jun 2008, 00:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS 5.5

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby Perryg » 24. Mar 2011, 19:30

Well did you do what the error message said to do?
yum install kernel-devel-2.6.18-194.32.1.el5.centos.plus
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby edrandall » 24. Mar 2011, 19:32

Yes I did that before I posted here:
Code: Select all   Expand viewCollapse view
# yum install kernel-devel-2.6.18-194.32.1.el5.centos.plus
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
addons                                                                                        |  951 B     00:00
base                                                                                          | 2.1 kB     00:00
extras                                                                                        | 2.1 kB     00:00
updates                                                                                       | 1.9 kB     00:00
Setting up Install Process
No package kernel-devel-2.6.18-194.32.1.el5.centos.plus available.
Nothing to do


Me setting KERN_DIR isn't going to have any effect; VBoxLinuxAdditions.run doesn't take that variable as a hint, it only sets it; line 1636:
Code: Select all   Expand viewCollapse view
test_sane_kernel_dir()
{
    KERN_VER=`uname -r`
    KERN_DIR="/lib/modules/$KERN_VER/build"
    if [ -d "$KERN_DIR" ]; then
        KERN_REL=`make -sC $KERN_DIR --no-print-directory kernelrelease 2>/dev/null || true`
        if [ -z "$KERN_REL" -o "x$KERN_REL" = "x$KERN_VER" ]; then
            return 0
        fi
    fi
   ...


I'll try a symlink in /usr/src/kernels;
Code: Select all   Expand viewCollapse view
 # ln -s 2.6.18-194.32.1.el5-x86_64 2.6.18-194.32.1.el5.centos.plus


Nope it's still not happy :cry:
Code: Select all   Expand viewCollapse view
The missing package can be probably installed with
yum install kernel-devel-2.6.18-194.32.1.el5.centos.plus
                                                           [FAILED]
edrandall
 
Posts: 10
Joined: 7. Jun 2008, 00:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS 5.5

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby edrandall » 24. Mar 2011, 19:37

Dargh wrong symlink name :oops:
Code: Select all   Expand viewCollapse view
# mv 2.6.18-194.32.1.el5.centos.plus 2.6.18-194.32.1.el5.centos.plus-x86_64


now maybe better, forgot the --nox11 this time but I don't care about that anyway:
Code: Select all   Expand viewCollapse view
 # ./VBoxLinuxAdditions.run
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
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-devel-2.6.18-194.32.1.el5.centos.plus

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                       [FAILED]
(Could not find the X.Org or XFree86 Window System.)
edrandall
 
Posts: 10
Joined: 7. Jun 2008, 00:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS 5.5

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby Perryg » 24. Mar 2011, 19:44

Code: Select all   Expand viewCollapse view
No package kernel-devel-2.6.18-194.32.1.el5.centos.plus available.

Is what is causing this to fail AFAICT. You should contact CentOS to see what can be done. I have seen this before when a yum update did not pull in the needed packages. Sometimes it is just that they have not made it to the tree yet. I remember one time when a user had to downgrade the kernel to be able to get all of the packages needed to be able to build external kernel modules.
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby edrandall » 24. Mar 2011, 20:20

I finally figured out the proper command to get the correct centos.plus kernel source (having removed the symlink hack first):
Code: Select all   Expand viewCollapse view
# yum --enablerepo=centosplus install kernel-devel-2.6.18-194.32.1.el5.centos.plus


Now all OK, thanks :D
Code: Select all   Expand viewCollapse view
# ./VBoxLinuxAdditions.run --nox11
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  ]
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers                       [FAILED]
(Could not find the X.Org or XFree86 Window System.)
edrandall
 
Posts: 10
Joined: 7. Jun 2008, 00:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS 5.5

Re: VB 4.x Guest Additions on CentOS 5.5 64-bit Server Install

Postby Perryg » 24. Mar 2011, 20:35

Thank you for posting the solution. I am sure that it will help others that happen to come across this issue.
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 11 guests