How To Install VirtualBox 5 Additions on CentOS 7
Introduction
In this post we will discuss how to get VirtualBox 5 guest additions installed on CentOS 7.
Installing VirtualBox Additions
First make sure updates have been applied and if there was a kernel update that the system was rebooted. Do this the typical way by running the command.
$ sudo yum -y update
Now that we have the latest updates and have rebooted we need to install epel to allow us to get some required packages needed for Guest Additions.
$ sudo yum install epel-release
Next we are ready to install dkms and kernel-devel that are required for guest additions to compile.
$ sudo yum install dkms kernel-devel
Install the guest additions. Click Devices > Install Guest Additions CD Image. If you have installed the GUI with CentOS 7 you will receive a popup asking if you want to install VBOXADDITIONS. Click Run and enter in your credentials and the installation will proceed. If you are not using the GUI open a terminal and type the following.
Note: The mount path will have your login id and the VBOXADDITIONS version maybe different. To get the correct path run the mount command.
$ cd /run/media/<yourid>/VBOXADDITIONS_5_0_2_102096
Now we can start the installer. At the terminal type:
$ sudo ./VBoxLinuxAdditions.run
Be patient and wait for the process to run.
Reboot and you will now have all the features that the Guest Additions will give.
Conclusion
And there we have it, you have the VirtualBox guest additions installed and working on your CentOS 7 system.
Thanks a lot for this!
I follow the steps, but cant get this to work. It keeps breaking the system. I get a window with a frown face and a message that says something went wrong.
At what point are you getting the frown? I am spinning up a new CentOS 7 core to see if I can replicate your error.
After reboot. I am able to enter the encryption password to boot the box, then when it loads i get a frowny face 🙁
I did a fresh install of CentOS 7 Server core and was able to install VirtualBox Additions 5.1.2 with no issues except a lag at first boot. Is the VL drive encrypted and if so what encryption did you use, this could be the issue.
So my computer is encrypted, which shouldnt matter I would think. I hadnt encrypted the VirtualBox instance, but I did select encryption during the installation. Should I not encrypt the centos virtual drive?
You shouldn’t need to encrypt the virtual system because it is already encrypted by the host OS. I have another system in which the host OS drive is encrypted, let me try a fresh CentOS install on it and see if I get the same error. Not sure if you have used the VirtualBox snapshot feature for before you make the changes but might be good to try.
Is there any certain installation I should be using? I’ve been trying with KDE plasma workspaces.
I have just been using Server with GUI and it shouldn’t mater that you are using with KDE Plasma. I am trying to replicate your issue will get back to you soon.
Thanks for this. Totally helpful. Just had to change the new version of the release and had it working in a minute.
Hey, thank you very much for this tutorial, it worked flawlessly! One thing is that it does take a couple restarts then I finally was able to get it to go into fullscreen but other than that, I am very thankful!
Appreciate it 🙂
Awesome, worked perfectly on CentOS 7 (1511)
Hello, thanks for you post and instructions. One thing, if installing on a minimal install, you also need the bzip2 package (for some reason that is not included in the minimal install).
I also typically install gcc, but I don’t know if that is required.
vboxadd.sh: Building Guest Additions kernel modules.
Failed to set up service vboxadd, please check the log file
It is probably looking for the kernel-devel. Try yum install kernel-devel-$(uname -r) and then retry
Worked like a charm! Thanks for this post!!
Thank you!!
It works!
I’m not getting the feedback that it installs all of the components for vboxadditions, but I also don’t see a failure. Any help to figure out what is going on?
In the post there is a screen shot showing OK for each of the compunents as they were compiled and added, it is not alot. If you see the same output then you are good. After reboot you can run the command ps -ef | grep -i vbox and you should see VBoxClient, VBoxService and VBoxWQueue
I have the same problem. It looks like it runs but I don’t see anything. Let me know if you got this to work.
You’re a Freekin Genius!!! I’ve looked at at least 50 different articles and tried everything I could find but this finally did the trick!!!
I am starting to mess around more with Linux. This was a problem for me and I tried several things. Finally, this setup worked! I realize this post is from 2015 and it is still helping out. Thank you!