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.
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?
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.
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?
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.
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:
./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.)
# ./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.)
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.
# ./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.)