Shared folders and desktop integration need support inside the virtual machine as well as settings on the host. VirtualBox Guest Additions supply that support on CentOS Stream, Red Hat Enterprise Linux, and Fedora through guest drivers and background services.
The ISO installation method fits guests without an existing distribution-managed Guest Additions package. Oracle bundles an installer that matches the host version with VirtualBox. Mixing installation sources can leave conflicting drivers or services.
The Linux installer builds drivers for the guest's running kernel, so its build files must match that kernel. Current DNF repositories are needed, including an active subscription or other authorized repository access on Red Hat Enterprise Linux. Administrator access inside the guest and a restart are required; installing the Extension Pack on the host does not replace Guest Additions.
Steps to install VirtualBox Guest Additions on CentOS, Red Hat, and Fedora:
- Update the packages inside the Linux guest.
Package updates can replace the kernel and other system components, and the reboots interrupt running applications. A VM snapshot provides a rollback if the subsequent driver installation prevents normal startup.
$ sudo dnf upgrade -y --refresh
- Reboot the guest into its updated kernel.
$ sudo reboot
- Install the build tools and development files for the running kernel.
$ sudo dnf install -y gcc make perl tar bzip2 which elfutils-libelf-devel "kernel-devel-$(uname -r)"
The version returned by uname -r selects the matching kernel-devel package. If DNF cannot find that exact package, the running kernel and enabled repositories need to be brought into agreement before installation can continue. The archive tools are needed even on a minimal server.
- Choose Devices → Insert Guest Additions CD image… in the running VM's VirtualBox window.
This attaches the host's Guest Additions ISO to the virtual optical drive; it does not install the drivers.
- Mount the Guest Additions disc read-only on the unused /mnt directory.
$ sudo mount -o ro /dev/sr0 /mnt
Here, /dev/sr0 is the guest's first virtual optical drive. If the VM has several optical drives, the Guest Additions disc may have a different device name.
- Run the Guest Additions installer for the guest's processor architecture.
The installer writes kernel drivers and system services inside the guest with root privileges. Secure Boot can reject unsigned modules; a guest that enforces it needs trusted module signatures before those drivers can load.
$ sudo sh /mnt/VBoxLinuxAdditions.run
The command above is for Intel/AMD guests. For an ARM64 guest, including one on an Apple silicon Mac, the installer is:
$ sudo sh /mnt/VBoxLinuxAdditions-arm64.run
A server without X.Org may report that graphics setup was skipped. Build failures are recorded in /var/log/vboxadd-setup.log; an installer exit code alone does not establish that the drivers and services are working.
- Restart the guest after the installer finishes.
$ sudo reboot
- Confirm that the installed Guest Additions kernel modules are loaded after the reboot.
$ sudo rcvboxadd status-kernel VirtualBox Guest Additions: kernel modules 7.2.22 r175245 are loaded
The reported version should match the installed Guest Additions. A missing-module or version-mismatch message means the installation has not completed successfully for the running kernel.
- Check that the Guest Additions background services are running.
$ sudo rcvboxadd status-user VirtualBox Guest Additions: user-land services 7.2.22 r175245 are running
The are running result confirms that the guest services started after reboot. Shared folders, clipboard sharing, and automatic resizing still need their respective VirtualBox settings enabled.