Installing VirtualBox Guest Additions on CentOS 7

    Download & Attach VirtualBox Guest Additions

    1. Download the appropriate version of VirtualBox Guest Additions. The
      latest would be VBoxGuestAdditions_5.1.20 at the time this article was written.
    2. Go ahead and attach the VirtualBox Guest Additions ISO as a device to the virtual machines storage. This is basically emulating a CD being inserted into our virtual machine.

    Prepare CentOS

    A few commands need to be ran in order to prepare CentOS for the VirtualBox Guest Additions install.

    At this point, if we try to mount and install VirtualBox Guest Additions, we’ll run into an issue where the install script cannot find or recognize the kernel. Below is a workaround I found for this issue.

    Finding and Fixing Kernel Issue

    The above will return what is in the /usr/src/kernels directory, which happens to be all of our kernel versions. Find the latest version, something like 3.10.0-514.16.1.el7.x86_64, and truncate it to the 5XX number. You’ll end up with 3.10.0-514.el7.x86_64 in this case. Now install this kernel-devel  before moving on.

    Mount and Install VirtualBox Guest Additions

    Here comes the easy part. Just mount the virtual cdrom and install the guest additions.

    This should run properly. After reboot, all guest additions will be ready to use. This includes the drivers, which is what we need to fix monitor resolutions.

    Manually Configure Monitor

    If you reboot and find your resolution is still not fixed, then you may have to manually configure your monitor with Xorg. It’s not as hard as it sounds.

    The above will show us if there are any configurations pertaining to monitors. If not, simply create a configuration file.

    Configure your monitor however you like. This is what I ended up with:

    Finally, after rebooting the virtual machine once again, the resolution should be fixed to whatever you set it as.

    4 Replies to “Installing VirtualBox Guest Additions on CentOS 7”

    Leave a Reply

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