Installing Guest Additions on CentOS 9 Stream for VirtualBox
In this article, we will guide you through the process of installing Guest Additions on CentOS 9 Stream for VirtualBox. The installation process is similar for other operating systems, such as Oracle Linux, Rocky Linux 9, and Ubuntu 24.04.1.
What are Guest Additions?
VirtualBox Guest Additions are a set of drivers and system applications designed to improve the performance and usability of virtual machines running in VirtualBox. By installing Guest Additions, you can achieve better video and mouse integration, shared folders, and copy and paste functionality between the host and guest systems.
Prerequisites
Before you begin, make sure your CentOS 9 Stream virtual machine meets the following requirements:
- CentOS 9 Stream is installed and running.
- VirtualBox is installed on the host system.
Inserting the Guest Additions CD
To start the installation, you need to mount the Guest Additions CD on your CentOS 9 Stream virtual machine. You can do this while the virtual machine is running using the VirtualBox menu:
- Select your CentOS 9 Stream virtual machine from the VirtualBox list.
- Click on "Devices" in the top menu, then select "Insert Guest Additions CD Image."
Installing Kernel Headers
Before installing the Guest Additions, you need to install the required kernel headers. Open a terminal window and run the following commands:
sudo dnf install kernel-headers-$(uname -r)
Installing Guest Additions
Now that the kernel headers are installed, you can start the Guest Additions installation process:
- In the terminal, navigate to the mounted Guest Additions CD:
cd /run/media/$(whoami)/VBOX_GAs_9.2.0
- Run the installation script:
sudo ./VBoxLinuxAdditions.run
During the installation, you may encounter some warnings. These are usually not a cause for concern. If any errors occur, make sure you have met the prerequisites before retrying the installation.
Configuring Shared Folders
Once the Guest Additions are installed, you can configure shared folders between the host and guest systems:
- In the VirtualBox window, select your CentOS 9 Stream virtual machine.
- Click on "Settings" in the top menu, then select "Shared Folders."
- Click the "Add" button to add a new shared folder.
- Select the folder you want to share and configure its settings, then click "OK."
The shared folder will be accessible under the /media directory in CentOS 9 Stream:
cd /media/sf_<shared\_folder\_name>
Installing Guest Additions on CentOS 9 Stream for VirtualBox provides several benefits, such as better functionality and performance. By following this guide, you can easily install and configure Guest Additions and shared folders for your CentOS 9 Stream virtual machine.