[RESOLVED] VBOX Guest Additions for CentOS 6.2

General support questions
dmischa
Posts: 58
Joined: 2011/03/21 14:46:56
Location: Germany

[RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by dmischa » 2011/12/21 11:17:57

under 6.2 the VBOX Guest Additions don't build properly. For details see

https://forums.virtualbox.org/viewtopic.php?f=1&t=46808#p211449

does anybody know which changes in the kernel headers could have caused it
(and what should be modifyed in vboxvideo_drm.c)?

dmischa
Posts: 58
Joined: 2011/03/21 14:46:56
Location: Germany

Re: VBOX Guest Additions for CentOS 6.2

Post by dmischa » 2011/12/21 14:42:31

[quote]
--- vboxvideo_drm.c.ori 2011-12-21 13:26:06.000000000 +0100
+++ vboxvideo_drm.c 2011-12-21 13:48:58.000000000 +0100
@@ -112,7 +112,7 @@
.poll = drm_poll,
.fasync = drm_fasync,
},
-#if LINUX_VERSION_CODE = KERNEL_VERSION (2, 6, 39)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 39) || defined(DRM_RHEL61)
static struct pci_driver pci_driver =
{
.name = DRIVER_NAME,
@@ -137,7 +137,7 @@

static int __init vboxvideo_init(void)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 39)
+#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 39) && !defined(DRM_RHEL61)
return drm_init(&driver);
#else
return drm_pci_init(&driver, &pci_driver);
@@ -146,7 +146,7 @@

static void __exit vboxvideo_exit(void)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 39)
+#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 39) && !defined(DRM_RHEL61)
drm_exit(&driver);
#else
drm_pci_exit(&driver, &pci_driver);

[/quote]

solves the problem for me

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: [RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by AlanBartlett » 2011/12/21 19:26:59

Thank you for your observation and solution.

For posterity (and on your behalf) this thread is marked [RESOLVED].

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

[RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by pschaff » 2012/01/03 21:58:22

I created a new Wiki page incorporating the patch procedure - [url=http://wiki.centos.org/HowTos/Virtualization/VirtualBox/CentOSguest]CentOS as a Guest OS in VirtualBox[/url].

r_hartman
Posts: 711
Joined: 2009/03/23 15:08:11
Location: Netherlands
Contact:

Re: [RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by r_hartman » 2012/01/04 07:10:08

Not sure this issue should be labeled 'resolved' yet.

I'm not at my own box right now, but I have an older version of VBox (from memory 4.0.10) and encountered the same issue. It started when updating to CentOS6.2, and the 2.6.32-220.el6.x86_64 kernel. Reverting to the previous kernel allowed me to rebuild the VBoxAdditions successfully, so my feeling is that it's more related to the 2.6.32-220.el6.x86_64 kernel than to the VBox version.

While it's nice that a patch to VBox apparently fixes this (haven't tried it yet) the problem was clearly introduced by a RHEL kernel change rather than a VBox change.

As the OP already asked: what has changed in the 2.6.32-220.el6.x86_64 kernel to introduce this issue, and is it to be considered a bug?
I have not tested yet whether the 2.6.32-220.2.1.el6.x86_64 kernel fixes it.

dmischa
Posts: 58
Joined: 2011/03/21 14:46:56
Location: Germany

Re: [RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by dmischa » 2012/01/04 09:43:36

[quote]
r_hartman wrote:
...

As the OP already asked: what has changed in the 2.6.32-220.el6.x86_64 kernel to introduce this issue, and is it to be considered a bug?
I have not tested yet whether the 2.6.32-220.2.1.el6.x86_64 kernel fixes it.[/quote]

if you compare the error messages at the VBOX forum with the patch, you find that the structure pci_driver and the functions drm_pci_init and drm_pci_exit were in 6.2 backported from the kernel 2.6..39.

r_hartman
Posts: 711
Joined: 2009/03/23 15:08:11
Location: Netherlands
Contact:

Re: [RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by r_hartman » 2012/01/04 14:40:42

Back at my own box, and updated to latest kernel
[code]$ uname -r
2.6.32-220.2.1.el6.x86_64[/code]
On reboot, VBoxGuest was installed by DKMS without issues and my CentOS6.2 client is working again as before.
Apparently, the 2.6.32-220.2.1 update fixed the issue introduced in the 2.6.32-220.

EDIT: Oh, my VBox (and guest) version is 4.0.12

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: [RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by pschaff » 2012/01/04 15:11:43

Not sure if VB 4.0 has anything to do with it, but I still get the error on 2.6.32-220.2.1.el6 with VirtualBox-4.1-4.1.8_75467_rhel6-1.x86_64. Host is RHEL6u2 and guest is CentOS-6.2 - up to date naturally. :-)

[code]
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.8 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.8 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 [[color=FF0000]FAILED[/color]]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions [ OK ]
Installing the Window System drivers
Installing X.Org Server 1.10 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 ]
Press Return to close this window...[/code]

The patch fixes it.

As far as the thread status - I still think this thread is [RESOLVED] although Oracle still needs to fix their Guest Additions. The OP may not agree, in which case we can consider changing the status.

r_hartman
Posts: 711
Joined: 2009/03/23 15:08:11
Location: Netherlands
Contact:

Re: [RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by r_hartman » 2012/01/04 18:38:26

Hmmm... Looks like DKMS grabbed the VBox modules compiled for the previous kernel, as my build-log (vboxadd-install.log) still mentions Dec 23 and kernel 2.6.32-131.17.1.el6.x86_64. DKMS-grab did not work when updating to 6.2 (on Dec 23), which made me reinstall the Guest Additions, which failed.
Then reverting to 2.6.32-131.17.1.el6.x86_64 allowed me to reinstall, and apparently those modules were now picked up by DKMS for the latest kernel, as everything works as expected.

Not sure how DKMS would manage to achieve this feat, but I'll leave things be for now.

Side effect of the failed install was that mount.vboxsf would not be installed, causing my vbox shared drive to fail (how this relates to OpenGL support failing is beyond me, but that was the only failure I had).
Reinstalling the guest additions will therefore likely fail again, given your report.

antony_sudhakar
Posts: 1
Joined: 2012/01/05 01:03:36

Re: [RESOLVED] VBOX Guest Additions for CentOS 6.2

Post by antony_sudhakar » 2012/01/05 01:12:07

Phil, your procedure from the wiki worked for me. However, the last tar command listed should be

cd ~/TMP2/
tar jcvf ../TMP/VBoxGuestAdditions-amd64.tar.bz2
cd ~/TMP
./install.sh

instead of tar jtvf.

Thanks for the great wiki!!

-Antony

Post Reply