Install VirtualBox Guest Additions on Oracle Linux 9

|
Last Updated:
|
|

Follow through this tutorial to learn how to install VirtualBox guest additions on Oracle Linux 9. VirtualBox guest additions “consist of device drivers and system applications that optimize the guest operating system for better performance and usability“.

VirtualBox guest additions can only be installed after the OS has been installed on VirtualBox. In our previous guide, we learnt how to install Oracle Linux 9 on VirtualBox;

Install Oracle Linux 9 on VirtualBox

Installing VirtualBox Guest Additions on Oracle Linux

The Guest Additions offer the following features:

  • Mouse pointer integration
  • Shared folders for easy sharing of files between the host and the guest
  • Ensures better and accelerated video performance.
  • Seamless windows integration
  • Generic host/guest communication channels that enables you to control and manage guest execution.
  • Provides Host-Guest time synchronization.
  • Shared clipboard between host and guest vm.
  • Automated logins.

The features are extensively explained on the VirtualBox User Manual.

Install Kernel Headers on Oracle Linux 9

To install VirtualBox guest additions, you need to ensure that the Kernel headers are installed. There are other development tools required.

Thus, begin by install EPEL repository on Oracle Linux;

dnf install epel-release -y

Next, install the kernel headers and build tools by executing the command below;

dnf install dkms kernel-uek-devel gcc make bzip2 perl elfutils-libelf-devel

Next, ensure that the version of kernel-euk-devel installed does match the version of your running kernel. You can verify by running the commands below.

rpm -q kernel-uek-develuname -r
kernel-uek-devel-5.15.0-1.43.4.2.el9uek.x86_645.15.0-1.43.4.2.el9uek.x86_64

Compare kernel version numbers

If they do not match, as shown in the outputs above, update your kernel by running;

sudo dnf update kernel-uek-* kernel-uek

Next, reboot the system and verify the kernel versions again. After the reboot, proceed with installation.

You can install VirtualBox guest additions via the command line or via GUI.

Install VirtualBox guest additions via CLI

Confirm VirtualBox version on your host;

VBoxManage --version

Sample output;

6.1.38r153438

Download VirtualBox Guest Additions ISO file of the same version as your installed VirtualBox.

wget http://download.virtualbox.org/virtualbox/6.1.38/VBoxGuestAdditions_6.1.38.iso -P /tmp

Mount the guest addition iso under the /mnt directory.

sudo mount /tmp/VBoxGuestAdditions_6.1.38.iso /mnt

Next, navigate to the mount directory and execute the Linux guest addition installer

cd /mnt
sudo ./VBoxLinuxAdditions.run

Or simply run;

sudo /mnt/VBoxLinuxAdditions.run

Sample installation output;


Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.38 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.1.38 of VirtualBox Guest Additions...
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.15.0-1.43.4.2.el9uek.x86_64.
ValueError: File context for /opt/VBoxGuestAdditions-6.1.38/other/mount.vboxsf already defined
VirtualBox Guest Additions: Running kernel modules will not be replaced until 
the system is restarted

Install VirtualBox guest additions ISO Inserting from Devices Menu

To begin with, ensure the VM has an empty controller IDE optical drive.

Install VirtualBox Guest Additions on Oracle Linux 9

Then, open the VM menu and navigate to Devices > Insert Guest Additions CD Image…

Next, mount the Guest Additions;

sudo mount /dev/cdrom /mnt/

Then install VirtualBox guest additions:

sudo /mnt/VBoxLinuxAdditions.run

Reboot Oracle Linux 9

After the installation is done, reboot the system to effect the changes;

sudo systemctl reboot -i

First thing after the system boots, after you login, it should auto-resize and set screen to full-screen.

If the system do not auto-resize the screen, toggle it on the VM menu by clicking View > Auto-resize Guest Display. This can only be done after login.

Install VirtualBox Guest Additions on Oracle Linux 9

And that is it on how to install VirtualBox guest additions on Oracle Linux 9. You can now enable other features such as shared clipboard, drag and drop between the host and virtual machine.

Other Tutorials

Install VirtualBox Guest Additions on Rocky Linux 9

Install VirtualBox Guest Additions on Kali Linux 2021.3

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

Leave a Comment