Posts Tagged ‘VirtualBox’

VirtualBox Guest Additions on OpenSuse 11.1

Saturday, September 5th, 2009

I wrote about the difficulties of installing VirtualBox Guest Additions in a Centos 5.3 x64 virtual machine (and how to get around them) some time ago. Well, the same thing happens in openSuse 11.1 -and the workaround is subtly different, so it warrants its own post!

As with Centos, the fundamental problem is that fresh, default openSuse installation includes neither the kernel headers nor the compiler necessary for building the VirtualBox additions modules. If you just try to run the provided Additions script, therefore, you get this error:

Please install the build and header files for your current Linux kernel.
The current kernel version is 2.6.27.7-9-default
Please install the GNU compiler.
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.

The fix is relatively simple, just as it is for Centos.  Open a terminal and become root (su – root), then type in this command:

zypper in gcc kernel-source

The relevant software should be downloaded from the installation DVD and installed. In all about 65MB of software will be downloaded, occupying nearly 300MB of disk space after installation. Once that’s done, you can run the VirtualBox additions script once more …and this time, things will work just fine. (Incidentally, I initially tried installing only the kernel-headers, since they are much smaller… but they mysteriously got installed at version 2.26.27-2.28, which didn’t match the kernel version in use as reported by the initial VirtualBox error message, and which therefore didn’t satisfy the VirtualBox installer in the slightest. Sources it had to be!)

Whilst on the subject, it’s perhaps worth pointing out that Ubuntu 9.04 x64 doesn’t suffer from this problem at all: the VirtualBox additions install without a problem immediately after a default installation of that particular distro. I guess life would be a lot simpler, but also a lot more boring, if all distros behaved the same way in these sorts of respects!

VirtualBox Additions for Centos 5.3 x64 Guests

Thursday, July 2nd, 2009

If you try to install the VirtualBox additions in a virgin Centos 5.3 x86_64 guest virtual machine, you’ll get these errors:

Please install the build and header files for your current Linux kernel.
The current kernel version is 2.6.18-53.el5
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.

The cure for these is to install the gcc (GNU C Compiler) and the Kernel Headers. I generally get gcc installed as a result of running my Doris script as preparation for doing an Oracle installation, but it doesn’t hurt to install it beforehand on its own (Doris will simply skip stuff she sees already installed by the time she runs). If that’s the case, the following command (run as root, of course) will do the trick:

yum -y install gcc kernel-devel-`uname -r`

Once that’s done, it’s just a question of clicking Devices -> Install Guest Additions if you haven’t already done so. That should cause a new ‘DVD’ to be automounted at /media. You can then invoke the Guest Additions installer (again, as root) by issuing the command:

sh /media/VBOXADDITIONS_2.2.4_47978/VBoxLinuxAdditions-amd64.run

The specific numbers in that command will, of course, depend on the specific version of VirtualBox you happen to be running. Generally, things will be plain sailing from this point on, though you will still get an error about the Centos kernel version not supporting OpenGL rendering. Ignore it, because it doesn’t really  affect the important stuff, such as proper mouse integration. However, you will still have rather peculiar graphics-related issues (such as the display size never being quite right enough to display both the top and bottom panels simultaneously), but they will be irritating but not fatal. (Here’s hoping the new VirtualBox 3.0 works better with Centos… but I haven’t managed to try it out just yet).

Update: I have now tried Centos 5.3 x86_64 in VirtualBox 3.0, and I am delighted to report that whilst the installation of the Guest Additions is as described above (that is, you still need to install gcc and the kernel headers beforehand), they now appear to work properly. You still get the error about OpenGL rendering, because that’s a kernel version issue (and RedHat/Centos 5 is not exactly on the bleeding edge of kernel versions!), but mouse integration works flawlessly and the display itself is correctly configured, properly able to display the whole screen without ’scrolling’ effects.

Please install the build and header files for your current Linux kernel.
The current kernel version is 2.6.18-53.el5xen
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.