Install Virtualbox guest additions on CentOs 8

Published: October 18, 2020 (Updated: Oct 18, 2020)

Enjoying this content? Subscribe to the Channel!

Make CentOS 8 Fullscreen: Installing VirtualBox Guest Additions the Right Way


Hi there, I’m Darren O’Neill from Darren’s Tech Tutorials, and if you’ve been struggling to get your CentOS 8 virtual machine to resize correctly, you’ve come to the right place!

It’s frustrating when you install a new operating system in VirtualBox and the screen is locked to a tiny resolution, refusing to expand no matter how much you stretch the window. The solution to this common problem is installing VirtualBox Guest Additions.

This comprehensive guide walks you through every necessary command and addresses a common stumbling block—the outdated VirtualBox host—that cost me hours of troubleshooting! Let’s get CentOS 8 running fullscreen!

Prerequisites and Crucial Troubleshooting

Before we jump into the Linux side of things, we need to address the most common reason the Guest Additions installation fails: your VirtualBox host software might be out of date.

If you follow all the steps below and the installation fails near the end, stop and do this first:

  1. Close and power off your CentOS 8 VM.
  2. Go to the official Oracle VirtualBox website.
  3. Download and install the latest version of the VirtualBox host software for your operating system (e.g., Windows hosts, macOS hosts).
  4. If your installer gives you an option to “Repair” or “Install,” ensure you run the installation process to fully update the host environment.

Once your host is updated, boot your CentOS 8 VM and proceed with the steps below!

Step 1: Update Your CentOS 8 System

It’s ethical practice and vital for compatibility to ensure your CentOS 8 installation is fully up to date before installing new kernel modules.

Open your terminal and run the full system update:

sudo yum update

This may involve downloading hundreds of megabytes worth of packages, depending on when you last ran the update. Confirm the installation and let it finish. Once complete, you are ready for the essential dependencies.

Step 2: Install Essential Dependencies

VirtualBox Guest Additions requires several development packages—including compilers, kernel headers, and build tools—to compile the necessary kernel modules specific to your machine.

Run the following command to download and install all the required packages at once.

Note: We are using yum for compatibility, which correctly resolves to dnf on CentOS 8/RHEL 8 variants.

sudo yum install tar bzip2 kernel-headers perl gcc make elfutils-libelf-devel

Confirm the installation when prompted and allow the process to finish.

Step 3: Reboot the System

Since we installed new kernel header files and development libraries, we need to reboot the operating system to ensure the running kernel is fully aligned with the new packages.

Run the following command in your terminal:

sudo reboot

Wait for the system to restart and log back into your CentOS 8 desktop environment.

Step 4: Mount and Run the Guest Additions CD Image

Now that the system is prepped, we can finally insert and run the Guest Additions software.

  1. In the VirtualBox VM window menu bar, click on Devices.
  2. Select Insert Guest Additions CD Image…

This action mounts a virtual CD drive inside your CentOS VM. You will likely see a prompt asking if you want to run the software.

  1. Click Run when prompted.
  2. Enter your user password to authenticate the installation.

The installation script will now run in the terminal, utilizing the build tools and headers we installed in Step 2. This process should only take a moment. Once complete, you will see a message prompting you to press Return to close the window.

Step 5: Final Reboot and Enjoy Fullscreen!

The Guest Additions modules have been installed, but they typically require a final reboot to initialize correctly and start running the video and clipboard drivers.

Run the reboot command one last time:

sudo reboot

Once the system restarts and you log back into your desktop environment, you should be able to grab the corner of your VirtualBox window and watch your CentOS 8 desktop expand to fit the screen!

Success Checklist:

  • You can resize the VM window dynamically.
  • You can now copy and paste between your host OS (Windows/Mac) and your CentOS 8 guest OS.

Conclusion

Getting VirtualBox Guest Additions installed can sometimes be a tricky process, especially dealing with package dependencies and outdated host software. But by following these five critical steps, your CentOS 8 installation is now fully optimized for development and daily use in VirtualBox!

If you ran into any issues, especially the failure scenario I discussed, remember to update that VirtualBox host software! Drop a comment below if you’re still running into trouble—I’m happy to help you troubleshoot.

If this guide helped you get fullscreen working, hit that like button and subscribe to Darren’s Tech Tutorials for more clear, practical technology guides! Thanks for tuning in!