How to install VirtualBox Guest Additions on Oracle Linux 8.5 VM

In the previous posts we saw how to install Oracle Linux 8.5 in a VirtualBox VM and the end user initial setup after the first connection. We are now going to see how to install the VirtualBox Guest Additions in order to allow a smooth integration with the host computer.

VirtualBox Guest Additions Installation
VirtualBox Guest Additions Installation

VirtualBox Guest Additions are not mandatory in order to use a Virtual Machine but they allow a smooth integration of the mouse, keyboard and to copy/paste text for instance between the host and guest systems. It is therefore a good idea to install them after a fresh installation of an operating system in a VM. So let’s see how to do it with an Oracle Linux 8.5 guest VM.

I was already connected to the VM as oracle so I selected the “Devices > Insert Guest Additions CD image…” VirtualBox menu.

Devices > Insert Guest Additions CD image
Devices > Insert Guest Additions CD image

Oracle Linux recognised the CD and asked me the permission to start the software it contained:

Start software
Start software

I clicked the “Run” button and I was asked by the system to authenticate to execute the software as super user:

Authentication required
Authentication required

I did it and the VirtualBox Guest Additions installation started in a new shell window:

Installation of VirtualBox Guest Additions starts
Installation of VirtualBox Guest Additions starts

But after a few seconds I get the dreaded “Kernel headers not found error for target kernel” error message:

Kernel headers not found error
Kernel headers not found error

The solution was therefore to install the missing target kernel headers.

First, I updated the list of packages using the “sudo yum update” command. There was nothing to update here because I had already updated the package list before trying to install the VirtualBox Guest Additions, but I have included the step anyway because you may need to execute this command before installing the package containing the current Linux kernel headers.

sudo yum update
sudo yum update

Later I checked what was the VM current Linux kernel version with the command “uname -r”:

uname -r
uname -r

The “uek” part in the the Linux kernel version identified that it was an “Unbreakable Enterprise Kernel (UEK)” built by Oracle and supported through Oracle Linux support. Therefore I needed to install the corresponding kernel header package.

I asked for a list of kernel related packages using the “yum list kernel*” command:

yum list kernel*
yum list kernel*

There were many kernel packages available and the one that I was looking for was “kernel-uek-devel.x86_64”:

kernel-uek-devel.x86_64
kernel-uek-devel.x86_64

I used the “sudo yum install kernel-uek-devel.x86_64″ command to install this package. It detected that the “binutils-devel” package needed to be installed too and asked for a confirmation.

sudo yum install kernel-uek-devel.x86_64
sudo yum install kernel-uek-devel.x86_64

I confirmed it with “y” and the two packages were downloaded and installed successfully:

Installing packages
Installing packages

I removed the VirtualBox Guest Additions CD from the virtual drive using the VirtualBox menu:

Removing VirtualBox Guest Additions disk
Removing VirtualBox Guest Additions disk

I reinserted the CD image:

Insert Guest Additions CD
Insert Guest Additions CD

And tried to install the VirtualBox Guest Additions again:

Run VirtualBox Guest Additions setup again
Run VirtualBox Guest Additions setup again
Authentication
Authentication

This time, the kernel modules were build without any issues and everything was installed correctly (the error message on the following screenshot had no consequences for the installation).

Building modules for kernel
Building modules for kernel

The VirtualBox Guest Additions were now installed and the mouse and keyboard interaction between the host and guest operating systems was now working smoothly!

It was now time to shutdown the VM and to backup the VM image just in case. But that’s something that we will see in an other post.

Disclaimer

The information contained in this Website is for general information purposes only. We try to keep this information up to date and correct but we make no warranties of any kind about the completeness, accuracy, reliability with respect to the website, the information or the graphics contained on the website for any purpose. Any reliance you place on such information is strictly at your own risk. In no event will we be liable for any loss or damage whatsoever from the use of this Website.

The post How to install VirtualBox Guest Additions on Oracle Linux 8.5 VM appeared first on MyBIJourney

All trademarks are properties of their respective owners.
FacebookTwitterPinterestWhatsAppMail