So you’ve just installed CentOS 7 Linux on your Virtualbox? CentOS 7 does not come with Guest Additions by default. In other words, you have to manually install the Virtualbox Guest Additions on CentOS 7. But don’t worry, we are going to show you how to do this in a moment.
Why do you need to install Guest Additions?
Well, Virtualbox Guest Additions is a software package that is required by the guest machine to get the most of the Virtualbox. With the Guest Additions, you will be able to switch to the full-screen mode, better keyboard and mouse integration, better graphics performance and many other benefits.
How to Install Virtualbox Guest Additions on CentOS 7?
Step 1. Update system and install Kernel
OK, now let’s get into the fun part. I assume you have already installed CentOS 7 on your Virtualbox. Now login and open Terminal. First, we need to update the system and then update the Kernel. Use the following command as root to update Kernel
yum update kernel*
After the installation, you will need to reboot CentOS.
Step 2. Install Additional Packages
In order to build the Guest Additions, CentOS 7 needs some packages such as gcc, kernel-devel and some more. These packages are available in the EPEL Repository. So, first, we need to install the EPEL repository on CentOS 7.
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Next, install the packages
yum install gcc kernel-devel kernel-headers dkms make bzip2 perl
Step 3. Add KERN_DIR Environment variable
Next, we need to add the KERN_DIR environment variable. Use the following command instead.
Step 4. Install Guest Additions
Before we can install the guest additions, we need to mount the ISO. Go to Devices >> Insert Guest Additions CD Image.
Next, you should see something like this on your CentOS desktop. Click Run and then enter your root password to continue.
In case you did not see the above window, you can do the following
make sure you change dhani with your actual user. Also, the VBox_GAs_6.0.10 should be changed depends on your Virtualbox version.
The installation will start and make sure the installation doesn’t produce any error. Now your guest additions should be ready.