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:
- 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.
- 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
- Reboot the system to apply any updates or changes.
$ sudo reboot
- Insert the Guest Additions CD image from the VirtualBox menu.
In the VirtualBox window, go to Devices → Insert Guest Additions CD Image.
- Mount the Guest Additions ISO if the system does not auto-mount.
$ sudo mkdir /mnt/cdrom $ sudo mount /dev/cdrom /mnt/cdrom
- 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.
- Verify that the necessary drivers and modules are installed.
$ lsmod | grep vbox vboxguest 45056 2 vboxsf 45056 1 vboxvideo 45056 1
- Reboot the virtual machine to complete the installation.
$ sudo reboot
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.