VirtualBox Guest Additions on Fedora 34/33, CentOS/RHEL 8/7/6/5 - Comment Page: 7
This is guide, howto install Oracle VirtualBox Guest Additions on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 34/33/32/31/30, CentOS 8.2/7.8/6.10/5.11, Red Hat (RHEL) 8.2/7.8/6.10/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 features provided by these VirtualBox Guest Additions are mouse pointer integration and arbitrary screen solutions (e.g. by resizing the guest window).
Check video version of guide:
Watch More Videos and Subscribe to if-not-true-then-false.com Youtube Channel
Note: Fedora 34/33/32/31/30...
hi. i have same issue.please help
[[email protected] yum.repos.d]# uname -a
Linux localhost.localdomain 3.11.10-301.fc20.x86_64 #1 SMP Thu Dec 5 14:01:17 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[[email protected] yum.repos.d]# rpm -qa kernel\* |sort -V
kernelshark-2.2.1-3.fc20.x86_64
kernel-3.11.10-301.fc20.x86_64
kernel-3.15.6-200.fc20.x86_64
kernel-debug-3.15.6-200.fc20.x86_64
kernel-debug-devel-3.15.6-200.fc20.x86_64
kernel-debug-modules-extra-3.15.6-200.fc20.x86_64
kernel-devel-3.15.6-200.fc20.x86_64
kernel-doc-3.15.6-200.fc20.noarch
kernel-headers-3.15.6-200.fc20.x86_64
kernel-modules-extra-3.11.10-301.fc20.x86_64
kernel-modules-extra-3.15.6-200.fc20.x86_64
kernel-tools-3.15.6-200.fc20.x86_64
kernel-tools-libs-3.15.6-200.fc20.x86_64
kernel-tools-libs-devel-3.15.6-200.fc20.x86_64
Hi I47,
Please boot using latest kernel 3.15.6-200.fc20.x86_64, then try again.
Hello, someone could help?
[[email protected] ~]# service vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)
[[email protected] ~]# cat /var/log/vbox-install.log
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.
uname -r
3.8.13-35.3.3.el6uek.x86_64
echo $KERN_DIR
/usr/src/kernels/2.6.32-431.23.3.el6.x86_64/
I’m new to Linux.
Thanks.
I followed your install process and this is what i got. I couldnt start up VB from the command line(although i was able to start using the front).
I also hav a problem when i was trying to mount the cdrom as additional mount.
Below is what i got. PLease help.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
VirtualBox-4.3 x86_64 4.3.14_95030_el6-1 virtualbox 75 M
Installing for dependencies:
SDL x86_64 1.2.14-3.el6 public_ol6_latest 192 k
Transaction Summary
================================================================================
Install 2 Package(s)
Total download size: 75 M
Installed size: 151 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): SDL-1.2.14-3.el6.x86_64.rpm | 192 kB 00:00
(2/2): VirtualBox-4.3-4.3.14_95030_el6-1.x86_64.rpm | 75 MB 01:36
——————————————————————————–
Total 790 kB/s | 75 MB 01:37
warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 98ab5139: NOKEY
Retrieving key from https://www.virtualbox.org/download/oracle_vbox.asc
Importing GPG key 0x98AB5139:
Userid: “Oracle Corporation (VirtualBox archive signing key) ”
From : https://www.virtualbox.org/download/oracle_vbox.asc
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : SDL-1.2.14-3.el6.x86_64 1/2
Installing : VirtualBox-4.3-4.3.14_95030_el6-1.x86_64 2/2
Creating group ‘vboxusers’. VM users must be member of that group!
No precompiled module for this kernel found — trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.
Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 2.6.32-358.el6.x86_64 cannot be found at
/lib/modules/2.6.32-358.el6.x86_64/build or /lib/modules/2.6.32-358.el6.x86_64/source.
[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)
Verifying : SDL-1.2.14-3.el6.x86_64 1/2
Verifying : VirtualBox-4.3-4.3.14_95030_el6-1.x86_64 2/2
Installed:
VirtualBox-4.3.x86_64 0:4.3.14_95030_el6-1
Dependency Installed:
SDL.x86_64 0:1.2.14-3.el6
Complete!
[[email protected] yum.repos.d]# service vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 2.6.32-358.el6.x86_64 cannot be found at
/lib/modules/2.6.32-358.el6.x86_64/build or /lib/modules/2.6.32-358.el6.x86_64/source.
[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)
[[email protected] yum.repos.d]# usermod -a -G vboxusers tricky
[[email protected] yum.repos.d]# VirtualBox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (2.6.32-358.el6.x86_64) or it failed to
load. Please recompile the kernel module and install it by
sudo /etc/init.d/vboxdrv setup
You will not be able to start VMs until this problem is fixed.
No protocol specified
Failed to open the X11 display!
[[email protected] yum.repos.d]# KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
[[email protected] yum.repos.d]# KERN_DIR=/usr/src/kernels/2.6.18-194.11.1.el5-x86_64
[[email protected] yum.repos.d]# export KERN_DIR
[[email protected] yum.repos.d]# cd ~
[[email protected] ~]# mkdir /media/VirtualBoxGuestAdditions
[[email protected] ~]# mount -r /dev/cdrom /media/VirtualBoxGuestAdditions
mount: you must specify the filesystem type
[[email protected] ~]# mount -r /dev/cdrom /media/VirtualBoxGuestAdditions
mount: you must specify the filesystem type
Hi tricky,
Could you first post output of following commands:
Hi, I know this is an old post but wanted to let you know I have been trying for 5 days to install VirtualBox Guest Additions on Centos 6. I have only had about 5 hrs sleep in those 5 days but your post did it for me. Thank you. At 3:32 am on the west coast I can finally get about 3 more hrs sleep then its back to work.
Great Post and thanks again
Paul
It seems like you should mount the Guest Additions CD image at the very end – since there are several reboot steps that would unmount the CD right? I noticed that once it came to actually running the installer from the CD, there was nothing in the previously mounted directory.
Good Tips – it works. For Centos 7 and for Centos 6 also.
Hi JR,
I have installed one Oracle Linux 6.6 hosted by Windows. I’m student and I used your post to install Guest Additions, just to split my screen in two parts, but after reboot process the Oracle VM VirtualBox is not resizing the screen. Could you please help me to solve this problem?
Regeards,
Rafael
su –
mkdir /media/vboxguest
run df -h
see where areyou seeing your VirtualBoxGuestAdditions media mostly in /media/VirtualBoxGuestAdditions or run/media/root/VirtualBoxGuestAdditions (on RHEL7)
go to that directory and execute cp /VBoxLinuxAdditions.run /media/vboxguest/
yum update kernel*
yum install gcc kernel-devel kernel-headers dkms make bzip2 perl
cd /media/vboxguest
run ./VBoxLinuxAdditions.run
no need to do any other step. in my case it worked always and have tried more than 20 times.
Thanks a lot for this post! It was a life-saver for me.
In certain regards I am forced to use CentOS and I don’t understand why this is so annoying compared to Ubuntu.
Thanks a Lot. Installed GA successfully for Centos 6.5 on VirtualBox with your guidelines.
Great instructions! Thanks so much–
Unfortunately my install with a Red Hat 6.7 guest failed during the:
sh ./VBoxLinuxAdditions.run
The output indicated:
Building the OpenGL support module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
The logfile indicated:
…
make KERNELRELEASE=2.6.32-573.1.1.el6.x86_64 -C /lib/modules/2.6.32-573.1.1.el6.x86_64/build M=/var/lib/dkms/vboxguest/4.3.30/build………(bad exit status: 2)
Error! Bad return status for module build on kernel: 2.6.32-573.1.1.el6.x86_64 (x86_64)
Consult /var/lib/dkms/vboxguest/4.3.30/build/make.log for more information.
…
and that logfile indicated:
…
In file included from /var/lib/dkms/vboxguest/4.3.30/build/vboxvideo/vboxvideo_drm.c:79:
include/drm/drmP.h:64:26: error: uapi/drm/drm.h: No such file or directory
include/drm/drmP.h:65:31: error: uapi/drm/drm_mode.h: No such file or directory
…
uapi/drm exists under /usr/include, so creating a symbolic link resulted in a different error in this log:
…
/var/lib/dkms/vboxguest/4.3.30/build/vboxvideo/vboxvideo_drm.c:129: error: ‘drm_mmap’ undeclared here (not in a function)
make[2]: *** [/var/lib/dkms/vboxguest/4.3.30/build/vboxvideo/vboxvideo_drm.o] Error 1
…
If I look at vboxvideo_drm.c, the corresponding code is:
…
# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
/* This shouldn't be necessary even for old kernels as there is
* nothing sensible to mmap. But we play safe and keep it for
* legacy reasons. */
.mmap = drm_mmap,
# endif
so it appears that VirtualBox hasn't pulled in the correct headers, or has a kernel mismatch.
Any idea what the source of the problem might be?
Thanks
Did you found any solution ?
Hi aga,
Check this comment.
Thank’s
After
export MAKE=’/usr/bin/gmake -i’
It work’s.
Unbelievable! This solution was posted 5 years ago and still helping to the folks!. Thank you so much JR
I am getting building opengl support failed error after doing these steps. Currently I have centOS6.7 version and virtual box 5.0
Hello Marc and Lakshmi,
You are totally right. VBoxGuestAdditions are not compatible with CentOS 6.7 kernel. Easy way is install older kernel and kernel-devel and use it. First update your host system and VirtualBox to version 5.0.2.
Then install CentOS 6.6 kernel
Then reboot and select kernel-2.6.32-504
Compile VirtualBox Linux Additions
And reboot once again and select kernel-2.6.32-504.
Next step is protect older kernel version, so yum update shouldn’t remove it:
Now you should have working VirtualBox Guest Additions on CentOS 6.7. You could try to rebuild Guest Additions when new kernels are released, but this is just simple workaround until Vbox Guest Additions are fixed.
I used this info to build the Guest Additions for CentOS 6.6, which works correctly, but I don’t understand how this works with CentOS 6.7. When I boot the v6.7 kernel, VirtualBox 4.3.30 tells me the Guest Additions are not installed. What am I missing here? Is there something I can run in the /opt Guest Additions folder that will install the Guest Additions into the v6.7 runtime environment without rebuilding them?
Hi curts,
You have to use 6.6 kernel if you want to use Guest Additions.
So you can use 6.7 kernel without Guest Additions or use 6.6 kernel with Guest Additions.
I have found a work-around to using guest-additions with CentOS 6.7 kernel:
export MAKE=’/usr/bin/gmake -i’
Excellent! Thanks for sharing JP!
Thank you so much for the information. I just upgraded to centOS 6.7 last night. This morning, I got “VBoxClient: the VirtualBox kernel service is not running. Exiting”. After finding this post about VBoxGuestAdditions are not compatible with the centOS6.7, I did the first step: install centOS6.6 kernel, and reboot and select kernel 2.6.32-504. The error message didn’t show up this time. Now, I need to do the second step: compile the VirtualBoxLinuxAdditions. In which folder should I run the command “./VirtualBoxLinuxAdditions.run”? My system could not find the command. Thank you for your help!
You are welcome!
Just run following commands:
Or directly:
I go by the code. Thank you
FYI fedora users:
Yum is depreciated in Fedora 22. For step 3, instead of “yum update kernel*” run:
dnf update kernel*
For those having problems with Step 6: “./VBoxLinuxAdditions.run” try the following:
Make sure you are set as root (su -, like it said in the beginning of the tutorial)
cd /run/media/YOURUSERNAMEHERE/
ls
You should see something like: VBOXADDITIONS_5.0.2_102096
cd VBOXADDITIONS_5.0.2_102096 (OR WHATEVER YOUR LISTED VBOXADDITION NUMBERS WERE)
./VBoxLinuxAdditions.run
reboot
Done! :)
Hi sawta,
I updated step 3. thanks.
If you run step 2. commands and then step 6. commands, then you shouldn’t have problems. :)
Actually it’s maybe better change step 2. and step 3. order.
The code is ©
Best VBGA instructions I’ve found! Thank you!