VirtualBox Guest Additions on Fedora 34/33, CentOS/RHEL 8/7/6/5 - 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 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...
The output from terminal after having followed your howto to the letter:
[[email protected] VBOXADDITIONS_4.2.6_82870]# ./VBoxLinuxAdditions.run
Verifying archive integrity… All good.
Uncompressing VirtualBox 4.2.6 Guest Additions for Linux……….
VirtualBox Guest Additions installer
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 [ÉCHOUÉ]
(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 ]
Is there a workaround?
Thanks for your contribution.
Mohand
Hi Mohand,
Could you post content of /var/log/vboxadd-install.log file?
And output of following commands:
Hi JR (Stetson and big smile?)
Thanks anyway, I managed to solve the issue by updating dkms and everything is OK now with the guest additions.
Fails on Centos 6.3 (running in VirtualBox on Windows 7). The mount command responds “you must specify the filesystem type”. (Specifying “-t autofs” or “-t iso9660” give various other failures).
Devices / Install Guest Additions may not be working right for some reason. It does un-grey the CD icon in the bottom of the window, though (whereas Devices / CD / Remove disk greys it out).
This is not an initial installation, I’m attempting to upgrade what’s inside the virtual machine in case it matters, after upgrading to 4.2.10 externally.
[…] Since you also asked about virtualbox-guest-additions, follow this guide: http://www.if-not-true-then-false.co…-red-hat-rhel/ […]
Very useful.. thanks for writing up!
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
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 ?
Hi Rico,
Run following commands and post output here:
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)
Hi Rico,
Try following:
Is it working then?
Already done, the result of my first post was running with this environment variable (I also try to put it in .bashrc file)
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.
Could you post output of following command:
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
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
FATAL: Error inserting vboxguest (/lib/modules/2.6.18-348.6.1.el5xen/extra/vboxguest.ko): Invalid module format
Hi again Rico,
I tested this little bit more.
First do you need that xen kernel what you are using?
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.
You are very welcome! Excellent to hear that you got it working!
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!
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:
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.
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
Hi Jose,
Excellent, really nice to hear that you got VirtualBox Guest Additions installed!
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
i get a black screen after fedora 19 loads, after completing all procedure successfully. i don’t see login screen
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…
Thank you very much. It worked like a charm.
I executed the commands
[email protected] cdrom]# cat /etc/*-release
CentOS release 5.6 (Final)
[[email protected] cdrom]# KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
[[email protected] cdrom]# export KERN_DIR
[[email protected] 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?
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.
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.
Hi hillct,
Thanks, excellent addition, guide updated.
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.