UX for Oracle VirtualBox — the undocumented instructions for OEL8!
Why do I need the Guest Additions for Oracle VirtualBox?
The official documentation describes the Oracle VirtualBox Guest Additions:
They consist of device drivers and system applications that optimize the guest operating system for better performance and usability.
When using a graphical user interface for the guest operating system, the Guest Additions add these features to the user experience:
- Mouse pointer integration.
- Shared folders.
- Better video support.
- Seamless windows.
- Generic host/guest communication channels.
- Time synchronization.
- Shared clipboard.
- Automated logins.
Guest Additions will be less useful for a virtual machine in headless mode, rather than for GUI mode. In any case, once the guest operating system is installed into a virtual machine, the Guest Additions can be installed into the guest operating system.
The official documentation of VirtualBox does provide some basic steps required to install Guest Additions into an Linux guest operating system.
However there are some prerequisites before starting the install.
Installation generally involves the following steps:
1. Before installing the Guest Additions, you prepare your guest system for building external kernel modules. This works as described in chapter 2.3.2, The Oracle VM VirtualBox Driver Modules, page 33, except that this step must be performed in your Linux guest instead of on a Linux host system.
Moreover, the official documentation does suggest there is some complexity required to install Guest Additions into a Linux guest operating system.
However, due to the significant differences between Linux distributions, installation may be slightly more complex when compared to Windows.
The differences between Linux distributions means the installation instructions can vary.
The following instructions are specifically for an OEL8 guest operating system, but other Linux distributions will be similar.
Preparation
The VirtualBox download will include the Guest Additions file named VBoxGuestAdditions.iso.
Place the file in a central location that is easily accessible to all your Oracle VirtualBox virtual machines. eg C:\Program Files\Oracle\VirtualBox.
Now with the virtual machine closed, configure the storage of the virtual machine so the OEL8 guest operating system can see the file.
While the virtual machine is running, you can virtually insert the VBoxGuestAdditions.iso CD file into your OEL8 guest’s virtual CD-ROM drive.
Then the contents of the iso file will be available for inspection through any file manager.
Update the guest operating system kernel
As a point of reference you can identify the current operating kernel for the OEL8 guest operating system.
# uname -r
4.18.0-147.el8_1.x86_64#
In addition, the official VirtualBox documentation points out the following about the system kernel.
Also ensure that all system updates have been installed and that your system is running the most up-to-date kernel for the distribution.
Consequently we are going to build a new guest system kernel, then use it for the new guest kernel.
Also the Guest Addition modules are going to be part of the guest system kernel, and the versions need to match. We will simply build the new guest system kernel to the latest version available in the Oracle Yum Repository.
Login to the root account, and install the following packages which are required to build the new kernel.
# yum install kernel-headers.x86_64# yum install kernel-devel.x86_64
In addition, there are several packages required for the compiler to build the new kernel.
# yum install gcc make perl# yum install elfutils-libelf-devel.x86_64
Now we are going to build the new kernel, using the update command.
# yum update kernel
For the new kernel to become the current one, simply reboot the virtual machine.
At the startup stage you’ll see the new kernel, and the previous one but the new one will be used by default. After startup, check the version of the new operating kernel again.
# uname -r
4.18.0-147.5.1.el8_1.x86_64#
Install the Guest Additions
Log into the root account, and navigate to the virtual CD-ROM:
# cd /run/media/root/VBox_GAs_6.0.14
Now we can start the install of the Guest Additions, which will build the additional modules for the new system kernel.
# sh ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.14 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 <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel
4.18.0-147.5.1.el8_1.x86_64.
ValueError: File context for /opt/VBoxGuestAdditions-6.0.14/other/mount.vboxsf already defined
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
#
Confirm that Virtualbox Guest Additions are installed and loaded:
# lsmod | grep vbox
vboxvideo 45056 0
drm_kms_helper 217088 2 vmwgfx,vboxvideo
ttm 110592 2 vmwgfx,vboxvideo
drm 524288 8 vmwgfx,drm_kms_helper,vboxvideo,ttm
vboxguest 380928 5
#
There are 2 modules built, and they are:
- vboxvideo
- vboxguest
More information can be found about those modules with the modinfo command.
# modinfo vboxvideo
filename: /lib/modules/4.18.0-147.5.1.el8_1.x86_64/misc/vboxvideo.ko
version: 6.0.14 r133895
license: GPL and additional rights
description: Oracle VM VirtualBox Graphics Card
author: Oracle Corporation
rhelversion: 8.1
srcversion: CDA8497FEFF8C7EC58D04D9
alias: pci:v000080EEd0000BEEFsv*sd*bc*sc*i*
depends: drm,drm_kms_helper,ttm
name: vboxvideo
vermagic: 4.18.0-147.5.1.el8_1.x86_64 SMP mod_unload modversions
parm: modeset:Disable/Enable modesetting (int)
#
# modinfo vboxguest
filename: /lib/modules/4.18.0-147.5.1.el8_1.x86_64/misc/vboxguest.ko
version: 6.0.14 r133895
license: GPL
description: Oracle VM VirtualBox Guest Additions for Linux Module
author: Oracle Corporation
rhelversion: 8.1
srcversion: 8CFB6C59E3FEF298C8E2B48
alias: pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:
name: vboxguest
vermagic: 4.18.0-147.5.1.el8_1.x86_64 SMP mod_unload modversions
#
There are many reasons to enhance the user experience of Oracle VirtualBox by using Guest Additions. In fact, Guest Additions can be regarded as more than just an optional extra, and a necessary part of any guest operating system that you create.
Paul Guerin is an international consultant that specialises in Oracle database. Paul is based from a global delivery center in South East Asia, but has clients from Australia, Europe, Asia, and North America. Moreover, he has presented at some of the world’s leading Oracle conferences, including Oracle Open World 2013. Since 2015, his work has been featured in the IOUG Best Practices Tip Booklet, and in publications from AUSOUG, Oracle Technology Network, and Oracle Developers (Medium). In 2019, he was awarded as a most valued contributor for the My Oracle Support Community. He is a DBA OCP, and continues to be a participant of the Oracle ACE program.