If you are trying to figure out how to install guest additions on Rocky Linux 9 OS, here’s the guide you need to follow.
VirtualBox is an open-source type2 hypervisor that can be used to create virtual machines that share the host’s resources. The VirtualBox guest additions optimize the performance and usability of the host machine.
After the guest operating system (OS) is installed, they can be installed inside the virtual machine. In this article, we will discuss the installation steps for VirtualBox guest addition on Rocky Linux 9.
What is VirtualBox guest addition?
The VirtualBox guest additions comprise a number of drivers and applications. It is used to optimize the performance and usability of the host machine. The VirtualBox guest addition provides the following features:
- It provides support for mouse pointer integration.
- It provides support for shared folders enabling easy sharing of files between guests and the host.
- It ensures better-accelerated video performance.
- It provides support for seamless video integrations.
- It has support for generic host/ guest communication channels. This enables the management and control of guest execution.
- It provides support for host-guest time synchronization.
- It has support for shared clipboard between host and guest virtual machine (VM).
- It supports automated login.
We will now discuss the installation of the VirtualBox guest addition. Follow the steps below for installation. However, before proceeding with the installation, ensure that you have a system with Rocky Linux 9 installed. In addition, VirtualBox should be installed on your machine.
Install Kernel Headers and Required Build Tools
The first step is the installation of kernel headers and required build tools.
Install required tools
Some of the required tools for installation are available at EPEL repos. Open your Terminal and type the following command to install the required build tools:
$dnf install epel-release –y
Install build tools and kernel headers
We will then install the build tools and kernel headers. For this purpose, type the following commands:
$dnf update --refresh –y
$dnf install dkms kernel-devel kernel-headers gcc make bzip2 perl elfutils-libelf-devel
Verify the version of kernel-devel
Now, ensure the kernel-devel version matches the running kernel version. For this purpose, run the below commands:
$rpm -q kernel-devel
$uname -r
$kernel-devel-5.14.0-70.13.1.el9_0.x86_64
$5.14.0-70.13.1.el9_0.x86_64
Now, compare the kernel versions. They should match.
Update the kernel
If the version numbers of the kernels don’t match, first update the kernel. For this purpose, type the following command:
$dnf update kernel-*
We will now install the VirtualBox guest additions on Rocky Linux 9. It can be installed in two ways: using the command line or through a graphical user interface (GUI). We will discuss both of the approaches for the installation.
How to Install Guest Additions on Rocky Linux 9 via the command line
Follow the steps below to install VirtualBox guest additions using the command line.
Check the version of VirtualBox
First, check the current version of the VirtualBox installed on your host. Type the following command on your Terminal:
$VBoxManage –version
You should see an output similar to the following:
6.1.34r150636
Download VirtualBox guest addition ISO file
Now download the VirtualBox guest addition ISO file. This should have the same version as the one installed on your machine. The following command can be used:
$wget http://download.virtualbox.org/virtualbox/6.1.34/VBoxGuestAdditions_6.1.34.iso -P /tmp
Mount the guest addition ISO
Now, mount the guest addition ISO file under the /run/media
directory. For this purpose, type the following command:
$mount /tmp/VBoxGuestAdditions_6.1.34.iso /run/media/
Execute the installer
Move to the mount directory using the following command:
$cd /run/media/
Now, execute the Linux guest addition installer as follows:
$./VBoxLinuxAdditions.run
Instead of moving to the directory, you can directly run the installer via the following command:
$/run/media/VBoxLinuxAdditions.run
It will take a while for the installation. You should see the following sample output:
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.34 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules. This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup
VirtualBox Guest Additions: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 5.14.0-70.13.1.el9_0.x86_64.
Reboot Rocky Linux
After the installation completes, reboot the Rocky Linux. After the system reboots, you should see the full-screen view. You should be able to auto-resize the screen. You can also toggle it by using the option View > Auto-resize Guest Display.
Congratulations, you have successfully installed guest additions on Rocky Linux.
How to Install VirtualBox Guest Additions via a GUI
Instead of using the command line interface, you can use the graphical user interface for installation. Follow the steps below for installation:
- Download the ISO file on your host
- Mount to the folder: /AlmaLinux 9 VM
- Using the graphical user interface, navigate to VM’s devices tab and load VirtualBox guest additions CD as shown in the snapshot below
- After it is loaded, proceed with the installation
Configuration of VM to use the guest additions
After installing VirtualBox’s guest additions, the next step is configuring various options such as drag and drop shared clipboard, USB drive, and shared folder. These steps can be easily performed from the graphical user interface.
In this article, we have discussed the installation steps for VirtualBox guest additions on Rocky Linux. The guest additions can be installed via the command line or graphical user interface.
After the installation, you need to configure several options, and appropriate help resources can be consulted for the configuration.
If this guide helped you, please share it.