VirtualBox Guest Additions improve the performance and integration of virtual machines running on CentOS, Red Hat, and Fedora. They provide features such as better screen resolution, shared clipboard, and folder sharing between the host and the virtual machine. Installing Guest Additions requires the system to have certain dependencies like kernel headers and development tools.

To install Guest Additions, the kernel headers must match the running kernel to avoid compatibility issues. The installation is done using a CD image that comes with VirtualBox. Once installed, these additions optimize the interaction between the host and the virtual machine, enhancing the user experience.

The process involves updating the system, installing necessary tools, mounting the Guest Additions ISO, and running the installation script. After installation, the virtual machine needs to be rebooted to apply the changes and ensure the enhancements are fully operational.

Steps to install VirtualBox Guest Additions on CentOS, Red Hat, and Fedora:

  1. Update the system to ensure all packages are up to date.
    $ sudo dnf update

    For older versions of CentOS or Red Hat, use yum instead of dnf.

  2. Install kernel headers and development tools needed for compilation.
    $ sudo dnf install gcc make perl kernel-devel kernel-headers

    Ensure that the installed kernel-devel matches the running kernel. Verify with the following command:

    $ uname -r
  3. Reboot the system to apply any updates or changes.
    $ sudo reboot
  4. Insert the Guest Additions CD image from the VirtualBox menu.

    In the VirtualBox window, go to DevicesInsert Guest Additions CD Image.

  5. Mount the Guest Additions ISO if the system does not auto-mount.
    $ sudo mkdir /mnt/cdrom
    $ sudo mount /dev/cdrom /mnt/cdrom
  6. Navigate to the mounted directory and run the Guest Additions installer.
    cd /mnt/cdrom
    $ sudo ./VBoxLinuxAdditions.run
    Verifying archive integrity... All good.
    Uncompressing VirtualBox 7.0.0 Guest Additions for Linux........
    Building the VirtualBox Guest Additions kernel modules...

    Ensure there are no errors during this step. If kernel version mismatches, install the correct version and reboot.

  7. Verify that the necessary drivers and modules are installed.
    $ lsmod | grep vbox
    vboxguest           45056   2
    vboxsf              45056   1
    vboxvideo           45056   1
  8. Reboot the virtual machine to complete the installation.
    $ sudo reboot
Discuss the article:

Comment anonymously. Login not required.