If Not True Then False

VirtualBox Guest Additions on Fedora 26/25, CentOS/RHEL 7.3/6.9/5.11 - Comment Page: 5

This is guide, howto install Oracle VirtualBox Guest Additions on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 26/25/24/23/22/21/20/19/18/17/16, CentOS 7.3/6.9/5.11, Red Hat (RHEL) 7.3/6.9/5.11. VirtualBox Guest Additions is special software that can be installed inside Linux virtual machines to improve performance and make integration much more seamless. Among the...
Categories:

240 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *

Input your comment.
help

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Input your name.

Art

Thanks, needed to figure out what t was needed to get the virtualbox update on openSuse 12.3 so your part on:

yum install gcc kernel-devel kernel-headers dkms make bzip2

solved it

used yast instead ( kernel-headers not needed)

thanks

reply Reply
Rico

Thanks for these details, very usefull.
But I’m facing another issue on CentOS 5.6 (after installing dkms, using the link Barry provides), in /var/log/vboxadd-install.log:
“DKMS: add Completed
Error! Your kernel headers for kernel 2.6.18-348.6.1.el5xen cannot be found at /lib/modules/2.6.18-348.6.1.el5xen/build or /lib/modules/2.6.18-348.6.1.el5xen/source.
…”
and if I run “yum install kernel-headers”:
“Package kernel-headers-2.6.18-348.6.1.el5.x86_64 already installed and latest version. Nothing to do”

Any suggestions ?

reply Reply
JR

Hi Rico,

Run following commands and post output here:


uname -a

ls -la /usr/src/kernels
reply Reply
Rico

Hi JR,
Many thanks for your interest in this topic.
uname -a:
Linux localhost.localdomain 2.6.18-348.6.1.el5xen #1 SMP Tue May 21 16:10:52 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

ls -al /usr/src/kernels:
drwxr-xr-x 3 root root 4096 juin 2 00:27 .
drwxr-xr-x 4 root root 4096 juin 3 13:45 ..
drwxr-xr-x 19 root root 4096 juin 3 13:34 2.6.18-348.6.1.el5-x86_64

(I hope there is no mistake because I can’t copy/paste)

reply Reply
JR

Hi Rico,

Try following:


KERN_DIR=/usr/src/kernels/2.6.18-348.6.1.el5-x86_64
 
## Export KERN_DIR ##
export KERN_DIR


cd /media/VirtualBoxGuestAdditions
 
# 32-bit and 64-bit systems run following
./VBoxLinuxAdditions.run

Is it working then?

reply Reply
Rico

Already done, the result of my first post was running with this environment variable (I also try to put it in .bashrc file)

reply Reply
Rico

I also try to change the link in /lib/modules/2.6.18-348.6.1.el5xen/build that was not correct to make it works:
Build -> /usr/src/kernels/2.6.18-348.6.1.el5-x86_64

The result seems to be a little bit better, but guest additions still not working after running VBoxLinuxAdditions.run:
Verifying archive integrity… All good
Uncompressing VirtualBox 4.2.12 Guest Additions for Linux ………
VirtualBox Guest Additions installer
Removing installer version 4.2.12 od VirtualBox GuestAdditions …
Copying additional installer modules …
Installing additional modules …
Removing existing VirtualBox DKMS kernel modules [OK]
Removing existing VirtualBox non-DKMS kernel modules [OK]
Building the VirtualBox Guest Additions kernel modules [OK]
Doing non-kernel setup of the Guest Additions [OK]
Starting the VirtualBox Guest Additions [FAILED]
(modprobe vboxguest failed)
Installing the window System drivers
Installing X.Org 7.1 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]

And if I restart the CentOS machine, it still not work ( can see in boot log that guest additions failed.

reply Reply
JR

Could you post output of following command:


modinfo vboxguest
reply Reply
Rico

One time again, thanks you JR.
modinfo vboxguest :
filename: /lib/modules/2.6.18-348.6.1.el5xen/extra/vboxguest.ko
version: 4.2.12
license: GPL
description: Oracle VM VirtualBox Guest Additions for Linux Module
author: Oracle Corporation
srcversion: 1EDD4C0A2A67D428711D0C7
alias: pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:
vermagic: 2.6.18-348.6.1.el5 SMP mod_unload gcc-4.1

reply Reply
JR

This looks interesting. This problem might be related to xen kernel version, but could you also try what you get when you try modprobe this module:


modprobe vboxguest
reply Reply
Rico

modprobe vboxguest
FATAL: Error inserting vboxguest (/lib/modules/2.6.18-348.6.1.el5xen/extra/vboxguest.ko): Invalid module format

JR

Hi again Rico,

I tested this little bit more.

First do you need that xen kernel what you are using?

reply Reply
Rico

Hi JR,
Today, I’m happy. I relaunch all the install procedure from scratch by creating a new VM and the VBox Additions work fine after following step by step your advices.

So i would like to adress you many and big thanks to you for helping me to do this work.

reply Reply
JR

You are very welcome! Excellent to hear that you got it working!

reply Reply
Jose

Hi JR,

Excelent guides, thank you!

I have a couple of questions:

1. In your second step you have click Devices > Install Guest Additons; I don’t have a Devices menu in my VirtualBox, only File, Machine and Help.

2. I have a netbook and don’t have a cdrom drive, so when I type mount -r /dev/cdrom /media/VirtualBoxGuestAdditions I get the error:
mount: special device /dev/cdrom does not exist

Thanks again!

reply Reply
JR

Hi Jose,

Thanks!

1. What version of VirtualBox (check Help > About VirtualBox…) you are running and what operating system you are using? Could you probably post screenshot of your VirtualBox window?

2. Actually this is your virtual machine /dev/cdrom and it’s not depending on your host machine. So if your netbook doesn’t have cdrom drive (which is normal case nowadays), it’s not problem, because you can add virtual CD/DVD device under Storage options. If you have not removed that device, then it should be there already.

And when you could click that “Install Guest Additions” (you can also try Host+D command) then you should be able to mount that device with following command:


mount -r /dev/cdrom /media/VirtualBoxGuestAdditions

This is probably even auto-mounted (under /media), but I use here just this command because, then path is exactly same even if you run some older version of VirtualBox or if it’s not auto-mounted some reason.

reply Reply
Jose

Hi JR,

Thamks for the quick reply!

I realise now that it was me being dumb. I need to do this in the Virtual Machine, not in the Virtual Box window. I can see the option Devices and Install Guest Additions in the Virtual Machine window.

Cheers,

Jose

reply Reply
JR

Hi Jose,

Excellent, really nice to hear that you got VirtualBox Guest Additions installed!

reply Reply
Brandon

FYI…
*On a fresh install of CentOS 6.4, without updating kernel…

`uname -r` reports “2.6.32-358.el6.x86_64” NOT “2.6.32-358.11.1.el6.x86_64” (actual path in /usr/src/kernels)

So, I did additional step:

ln -s /usr/src/kernels/2.6.32-358.11.1.el6.x86_64/ /usr/src/kernels/2.6.32-358.el6.x86_64

This also fixes the broken symlinks in /lib/modules/2.6.32-358.el6.x86_64

reply Reply
Nikhil

i get a black screen after fedora 19 loads, after completing all procedure successfully. i don’t see login screen

reply Reply
AMI

same result – Black Screen Of Death :]
VB 4.2.12 on Win7ENT64
Fedora 19 kernel was updated to the latest version 3.9.9-301.fc19.i686.PAE
trying to upgrade VB to 4.2.16…

reply Reply
tatiana

I executed the commands
root@pal cdrom]# cat /etc/*-release
CentOS release 5.6 (Final)
[root@pal cdrom]# KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
[root@pal cdrom]# export KERN_DIR
[root@pal cdrom]# ./VBoxLinuxAdditions.run
but I get an error at the end:
Verifying archive integrity… All good.
Uncompressing VirtualBox 4.2.12 Guest Additions for Linux…………
VirtualBox Guest Additions installer
Removing installed version 4.2.12 of VirtualBox Guest Additions…
Copying additional installer modules …
Installing additional modules …
Removing existing VirtualBox DKMS kernel modules [ OK ]
Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules [ 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.)
I’m not sure what
Window System drivers
is.
suggestions?

reply Reply
JR

Hi tatiana,

Do you have server installation?

VirtualBox Guest Additions try to install some desktop features, like seamless mode, copy and paste, etc. but actually you don’t need those on server installation. If you want it run without errors (and install Window System drivers), then you have to install Xorg first.

reply Reply
hillct

While this is likely not an issue for most users, the minimal install of Centos 6 does not include perl, which is (ridiculously) a dependency of the VirtualBox linux additions as of v4.3 and possibly earlier, so you might add perl to your yum install line (only the base modules are required) to be safe.

reply Reply
Daniel Fonseca

Hi!

Thanks for this guide, it’s helped me install those precious vbox guest additions here on the Retina MBP. ;)

Just a quick note, on Fedora 20, at least in my case (32bit) I needed this extra bit:
yum install kernel-PAE-devel

Some people might be needing it too, the PAE kernel (was somehow installed by default, with 3GB RAM) let’s you use over 4GB on 32bit.

Unfortunately Linux doesn’t seem to go over 2048×1280 but it’s already huge on a 13″! :)

Cheers.

reply Reply
gio

Thank you for this guide. I had to add my user to the group vboxsf to gain access to the shared folder with

gpasswd -a myuser vboxsf

reply Reply
Kevin

Took me a bit to figure out why I did not have permission to access the shared folder once I got the guest additions installed. (I think the first time I ran it, it may have said something about creating the group, but nothing after I followed this guide and ran the script again.)


## Join virtual box shared folder group
usermod -a -G vboxsf <USERNAME>

reply Reply
Jinder Aujla

Really hoping someone out there can help me trying to install guest additions for Centos 6.5 using version 4.3.6 of VirtualBox, this is the output from the install


sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.6 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.6 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
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)
Doing non-kernel setup of the Guest Additions [ OK ]
Installing the Window System drivers
Installing X.Org Server 1.13 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 ]

Contents of log:


Uninstalling modules from DKMS
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxguest/4.3.6/source ->
/usr/src/vboxguest-4.3.6

DKMS: add completed.

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...
make KERNELRELEASE=2.6.32-431.3.1.el6.x86_64 -C /lib/modules/2.6.32-431.3.1.el6.x86_64/build M=/var/lib/dkms/vboxguest/4.3.6/build...........(bad exit status: 2)
Error! Bad return status for module build on kernel: 2.6.32-431.3.1.el6.x86_64 (x86_64)
Consult /var/lib/dkms/vboxguest/4.3.6/build/make.log for more information.
Failed to install using DKMS, attempting to install without
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/2.6.32-431.3.1.el6.x86_64/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)

Some environment stuff:

sudo rpm -qa kernel\* gcc dkms make bzip2
kernel-firmware-2.6.32-431.3.1.el6.noarch
bzip2-1.0.5-7.el6_0.x86_64
kernel-headers-2.6.32-431.3.1.el6.x86_64
dkms-2.2.0.3-20.el6.noarch
kernel-2.6.32-358.el6.x86_64
kernel-devel-2.6.32-431.3.1.el6.x86_64
kernel-devel-2.6.32-358.el6.x86_64
gcc-4.4.7-4.el6.x86_64
kernel-2.6.32-431.3.1.el6.x86_64
make-3.81-20.el6.x86_64

uname -a
Linux localhost.localdomain 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final

All help greatly appreciated

reply Reply
bandit

I had to use the info that brandon posted above
ln -s /usr/src/kernels/2.6.32-431.3.1.el6.x86_64/ /usr/src/kernels/2.6.32-431.el6.x86_64
it does not like the extra kernel info 3.1.
and the fix from
http://wiki.centos.org/HowTos/Virtualization/VirtualBox/CentOSguest
Patch for CentOS 6.5 with VBOXADDITIONS_4.3.2/4.3.4
cd /usr/src/kernels//include/drm/
ln -s /usr/include/drm/drm.h drm.h
ln -s /usr/include/drm/drm_sarea.h drm_sarea.h
ln -s /usr/include/drm/drm_mode.h drm_mode.h
ln -s /usr/include/drm/drm_fourcc.h drm_fourcc.h

which is linked from https://forums.virtualbox.org/viewtopic.php?f=3&t=58855

reply Reply