How to Install Virtualbox on Rocky Linux 8.6

To Install VirtualBox On Rocky Linux 8.6

Introduction:

Oracle is an open-source and free-to-use virtualization tool that is known as VirtualBox. It is recognized as one of the best cross-platform applications for developing virtual machines within an operating system and running them simultaneously. It is available in all major Operating systems like macOS, Windows, and Linux.

Installation Procedure:

Step 1: Check the OS version by using the below command

[root@linuxhelp ~]# cat /etc/os-release 
NAME="Rocky Linux"
VERSION="8.6 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.6 (Green Obsidian)"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8"

Step 2: Run the dnf cache make cache command by using the below command

[root@linuxhelp ~]# dnf makecache
Rocky Linux 8 - AppStream                                           5.2 kB/s | 4.8 kB     00:00    
Rocky Linux 8 - AppStream                                           3.7 MB/s |  11 MB     00:03    
Rocky Linux 8 - BaseOS                                              5.0 kB/s | 4.3 kB     00:00    
Rocky Linux 8 - BaseOS                                              6.3 MB/s | 8.0 MB     00:01    
Rocky Linux 8 - Extras                                              3.8 kB/s | 3.5 kB     00:00    
Rocky Linux 8 - Extras                                               12 kB/s |  12 kB     00:01    
Metadata cache created.

Step 3: Update the repository by running the below command

[root@linuxhelp ~]# yum update 
Last metadata expiration check: 0:00:13 ago on Friday 28 October 2022 04:10:40 AM IST.
Dependencies resolved.
====================================================================================================
 Package                         Arch   Version                                     Repo       Size


====================================================================================================
Upgrading:
 NetworkManager                  x86_64 1:1.36.0-9.el8_6                            baseos    2.3 M
 NetworkManager-adsl             x86_64 1:1.36.0-9.el8_6                            baseos    149 k
 NetworkManager-bluetooth        x86_64 1:1.36.0-9.el8_6                            baseos    174 k
 NetworkManager-config-server    noarch 1:1.36.0-9.el8_6                            baseos    136 k
 NetworkManager-libnm            x86_64 1:1.36.0-9.el8_6                            baseos    1.8 M
 NetworkManager-team             x86_64 1:1.36.0-9.el8_6                            baseos    152 k
 systemd-udev                    x86_64 239-58.el8_6.8                              baseos    1.6 M
 tzdata                          noarch 2022e-1.el8                                 baseos    470 k
 zlib                            x86_64 1.2.11-19.el8_6                             baseos    102 k

Transaction Summary
====================================================================================================
Upgrade  120 Packages

Total download size: 430 M
Is this ok [y/N]: y
Downloading Packages:
(1/120): bind-license-9.11.36-3.el8_6.1.noarch.rpm                  517 kB/s | 102 kB     00:00    
(2/120): bind-libs-9.11.36-3.el8_6.1.x86_64.rpm                     744 kB/s | 174 kB     00:00    
(3/120): bind-utils-9.11.36-3.el8_6.1.x86_64.rpm                    4.0 MB/s | 450 kB     00:00    
(4/120): bind-libs-lite-9.11.36-3.el8_6.1.x86_64.rpm                3.5 MB/s | 1.2 MB     00:00    
(5/120): cockpit-podman-49.1-1.module+el8.6.0+1054+50b00ff4.noarch. 8.4 MB/s | 523 kB     00:00    



(6/120): conmon-2.1.3-1.module+el8.6.0+1054+50b00ff4.x86_64.rpm     1.3 MB/s |  55 kB     00:00    
(119/120): zlib-1.2.11-19.el8_6.x86_64.rpm                          2.1 MB/s | 102 kB     00:00    
(120/120): linux-firmware-20220210-108.git6342082c.el8_6.noarch.rpm  30 MB/s | 196 MB     00:06    
----------------------------------------------------------------------------------------------------
Total                                                                34 MB/s | 430 MB     00:12     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                            1/1 
  Running scriptlet: zlib-1.2.11-19.el8_6.x86_64                                                1/1 
  Upgrading        : zlib-1.2.11-19.el8_6.x86_64                                              1/240 
  Upgrading        : systemd-libs-239-58.el8_6.8.x86_64                                       2/240 
  Running scriptlet: systemd-libs-239-58.el8_6.8.x86_64                                       2/240 
  Upgrading        : gnutls-3.6.16-5.el8_6.x86_64                                             3/240 
  Cleanup          : qemu-kvm-hw-usbredir-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_   223/240 
  Cleanup          : bind-license-32:9.11.36-3.el8.noarch                                   224/240 
  Running scriptlet: qemu-kvm-common-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_64      225/240 
  Cleanup          : qemu-kvm-common-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_64      225/240 
  Running scriptlet: qemu-kvm-common-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_64      225/240 
  Cleanup          : glib2-2.56.4-158.el8.x86_64                                            226/240 
  Running scriptlet: systemd-239-58.el8_6.7.x86_64                                          227/240 
  Cleanup          : systemd-239-58.el8_6.7.x86_64                                          227/240 
  Cleanup          : seabios-bin-1.15.0-2.module+el8.6.0+847+b490afdd.noarch                228/240 
  Cleanup          : seavgabios-bin-1.15.0-2.module+el8.6.0+847+b490afdd.noarch             229/240 


  Cleanup          : device-mapper-multipath-libs-0.8.4-22.el8_6.1.x86_64                   230/240 
  Running scriptlet: device-mapper-multipath-libs-0.8.4-22.el8_6.1.x86_64                   230/240 

  Verifying        : qemu-kvm-core-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_64        100/240 
  Verifying        : qemu-kvm-docs-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64        101/240 
  Verifying        : qemu-kvm-docs-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_64        102/240 
  Verifying        : qemu-kvm-hw-usbredir-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_   103/240 
  Verifying        : qemu-kvm-hw-usbredir-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_   104/240 
  Verifying        : qemu-kvm-ui-opengl-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64   105/240 
  Verifying        : qemu-kvm-ui-opengl-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_64   106/240 
  Verifying        : qemu-kvm-ui-spice-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64    107/240 
  Verifying        : qemu-kvm-ui-spice-15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5.x86_64    108/240 
  Verifying        : runc-1:1.1.3-2.module+el8.6.0+1054+50b00ff4.x86_64                     109/240 
  Verifying        : runc-1:1.1.3-2.module+el8.6.0+997+05c9d812.x86_64                      110/240 
  Verifying        : seabios-bin-1.15.0-2.module+el8.6.0+1052+ff61d164.noarch               111/240 
  Verifying        : seabios-bin-1.15.0-2.module+el8.6.0+847+b490afdd.noarch                112/240 
  Verifying        : seavgabios-bin-1.15.0-2.module+el8.6.0+1052+ff61d164.noarch            113/240 
  Verifying        : seavgabios-bin-1.15.0-2.module+el8.6.0+847+b490afdd.noarch             114/240 
  Verifying        : slirp4netns-1.2.0-2.module+el8.6.0+1054+50b00ff4.x86_64                115/240 
  Verifying        : slirp4netns-1.2.0-2.module+el8.6.0+997+05c9d812.x86_64                 116/240 

  Verifying        : swtpm-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1052+ff61d164.x86_64   117/240 
  Verifying        : swtpm-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1000+18e3b59f.x86_64   118/240 
  Verifying        : swtpm-libs-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1052+ff61d164.x   119/240 
  Verifying        : swtpm-libs-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1000+18e3b59f.x   120/240 
  Verifying        : swtpm-tools-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1052+ff61d164.   121/240 
  Verifying        : swtpm-tools-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1000+18e3b59f.   122/240 
  Verifying        : NetworkManager-1:1.36.0-9.el8_6.x86_64                                 123/240 
  Verifying        : NetworkManager-1:1.36.0-7.el8_6.x86_64                                 124/240 
  Verifying        : NetworkManager-adsl-1:1.36.0-9.el8_6.x86_64                            125/240 
  Verifying        : NetworkManager-adsl-1:1.36.0-7.el8_6.x86_64                            126/240 
  Verifying        : NetworkManager-bluetooth-1:1.36.0-9.el8_6.x86_64                       127/240 
  Verifying        : NetworkManager-bluetooth-1:1.36.0-7.el8_6.x86_64                       128/240 
  Verifying        : NetworkManager-config-server-1:1.36.0-9.el8_6.noarch                   129/240 
  Verifying        : NetworkManager-config-server-1:1.36.0-7.el8_6.noarch                   130/240 
  Verifying        : NetworkManager-libnm-1:1.36.0-9.el8_6.x86_64                           131/240 
  Verifying        : NetworkManager-libnm-1:1.36.0-7.el8_6.x86_64                           132/240 
  Verifying        : NetworkManager-team-1:1.36.0-9.el8_6.x86_64                            133/240 
  Verifying        : NetworkManager-team-1:1.36.0-7.el8_6.x86_64                            134/240 
  Verifying        : NetworkManager-tui-1:1.36.0-9.el8_6.x86_64                             135/240 


  Verifying        : NetworkManager-tui-1:1.36.0-7.el8_6.x86_64                             136/240 
  Verifying        : NetworkManager-wifi-1:1.36.0-9.el8_6.x86_64                            137/240 
  Verifying        : NetworkManager-wifi-1:1.36.0-7.el8_6.x86_64                            138/240 
  Verifying        : NetworkManager-wwan-1:1.36.0-9.el8_6.x86_64                            139/240 
  Verifying        : NetworkManager-wwan-1:1.36.0-7.el8_6.x86_64                            140/240 
  Verifying        : cockpit-264.2-1.el8_6.x86_64                                           141/240 
  Verifying        : cockpit-264.1-1.el8.x86_64                                             142/240 
  Verifying        : cockpit-bridge-264.2-1.el8_6.x86_64                                    143/240 
  Verifying        : cockpit-bridge-264.1-1.el8.x86_64                                      144/240 
  Verifying        : cockpit-system-264.2-1.el8_6.noarch                                    145/240 
  Verifying        : cockpit-system-264.1-1.el8.noarch                                      146/240 
  Verifying        : cockpit-ws-264.2-1.el8_6.x86_64                                        147/240 
  Verifying        : cockpit-ws-264.1-1.el8.x86_64                                          148/240 
  Verifying        : device-mapper-multipath-0.8.4-22.el8_6.2.x86_64                        149/240 
  Verifying        : device-mapper-multipath-0.8.4-22.el8_6.1.x86_64                        150/240 
  Verifying        : device-mapper-multipath-libs-0.8.4-22.el8_6.2.x86_64                   151/240 
  Verifying        : device-mapper-multipath-libs-0.8.4-22.el8_6.1.x86_64                   152/240 

  qemu-kvm-common-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64                                 
  qemu-kvm-core-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64                                   
  qemu-kvm-docs-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64                                   
  qemu-kvm-hw-usbredir-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64                            
  qemu-kvm-ui-opengl-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64                              
  qemu-kvm-ui-spice-15:6.2.0-11.module+el8.6.0+1052+ff61d164.6.x86_64                               
  rpm-4.14.3-24.el8_6.x86_64                                                                        
  rpm-build-libs-4.14.3-24.el8_6.x86_64                                                             
  rpm-libs-4.14.3-24.el8_6.x86_64                                                                   
  rpm-plugin-selinux-4.14.3-24.el8_6.x86_64                                                         
  rpm-plugin-systemd-inhibit-4.14.3-24.el8_6.x86_64                                                 
  runc-1:1.1.3-2.module+el8.6.0+1054+50b00ff4.x86_64          
                                      
  samba-client-libs-4.15.5-10.el8_6.x86_64                                                          
  samba-common-4.15.5-10.el8_6.noarch                                                               
  samba-common-libs-4.15.5-10.el8_6.x86_64                                                          
  seabios-bin-1.15.0-2.module+el8.6.0+1052+ff61d164.noarch                                          
  seavgabios-bin-1.15.0-2.module+el8.6.0+1052+ff61d164.noarch                                       
  slirp4netns-1.2.0-2.module+el8.6.0+1054+50b00ff4.x86_64                                           
  sos-4.2-22.el8_6.noarch                                                                           
  sqlite-3.26.0-16.el8_6.x86_64                                                                     
  sqlite-libs-3.26.0-16.el8_6.x86_64                                                                
  swtpm-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1052+ff61d164.x86_64                              
  swtpm-libs-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1052+ff61d164.x86_64                         
  swtpm-tools-0.7.0-3.20211109gitb79fd91.module+el8.6.0+1052+ff61d164.x86_64                        
  systemd-239-58.el8_6.8.x86_64                                                                     
  systemd-container-239-58.el8_6.8.x86_64                                                           
  systemd-libs-239-58.el8_6.8.x86_64                                                                
  systemd-pam-239-58.el8_6.8.x86_64                                                                 
  systemd-udev-239-58.el8_6.8.x86_64                                                                
  tzdata-2022e-1.el8.noarch                                                                         
  zlib-1.2.11-19.el8_6.x86_64                                                                       

Complete!

Step 4: Add the virtual box repo by using the below command

[root@linuxhelp ~]# dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
Adding repo from: https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo

Step 5: Check the repositories in the repo location by using the below command

[root@linuxhelp ~]# cd /etc/yum.repos.d/
[root@linuxhelp yum.repos.d]# 
[root@linuxhelp yum.repos.d]# ll
total 56
-rw-r--r--. 1 root root  710 Aug 30 14:35 Rocky-AppStream.repo
-rw-r--r--. 1 root root  695 Aug 30 14:35 Rocky-BaseOS.repo
-rw-r--r--. 1 root root 1753 Aug 30 14:35 Rocky-Debuginfo.repo
-rw-r--r--. 1 root root  360 Aug 30 14:35 Rocky-Devel.repo
-rw-r--r--. 1 root root  695 Aug 30 14:35 Rocky-Extras.repo
-rw-r--r--. 1 root root  731 Aug 30 14:35 Rocky-HighAvailability.repo
-rw-r--r--. 1 root root  680 Aug 30 14:35 Rocky-Media.repo
-rw-r--r--. 1 root root  680 Aug 30 14:35 Rocky-NFV.repo
-rw-r--r--. 1 root root  690 Aug 30 14:35 Rocky-Plus.repo
-rw-r--r--. 1 root root  715 Aug 30 14:35 Rocky-PowerTools.repo
-rw-r--r--. 1 root root  746 Aug 30 14:35 Rocky-ResilientStorage.repo
-rw-r--r--. 1 root root  681 Aug 30 14:35 Rocky-RT.repo
-rw-r--r--. 1 root root 2335 Aug 30 14:35 Rocky-Sources.repo
-rw-r--r--. 1 root root  259 Oct 28 04:16 virtualbox.repo

[root@linuxhelp yum.repos.d]# rm -rvf virtualbox.repo 
removed 'virtualbox.repo'

[root@linuxhelp yum.repos.d]# cd 

Step 6: Install the virtual box by using the below command

[root@linuxhelp ~]# dnf install VirtualBox-7.0 
Oracle Linux / RHEL / CentOS-8 / x86_64 - VirtualBox                313  B/s | 181  B     00:00    
Dependencies resolved.
====================================================================================================
 Package                       Architecture   Version                      Repository          Size
====================================================================================================
Installing:
 VirtualBox-7.0                x86_64         7.0.2_154219_el8-1           virtualbox          93 M
Installing dependencies:
 mesa-vulkan-drivers           x86_64         21.3.4-1.el8                 appstream          6.7 M
 pcre2-utf16                   x86_64         10.32-3.el8_6                baseos             228 k
 qt5-qtbase                    x86_64         5.15.2-4.el8                 appstream          3.6 M
 qt5-qtbase-common             noarch         5.15.2-4.el8                 appstream           40 k


 qt5-qtbase-gui                x86_64         5.15.2-4.el8                 appstream          6.1 M
 qt5-qttools-common            noarch         5.15.2-4.el8.0.1             appstream           20 k
 qt5-qttools-libs-help         x86_64         5.15.2-4.el8.0.1             appstream          193 k
 qt5-qtx11extras               x86_64         5.15.2-2.el8.0.1             appstream           39 k
 vulkan-loader                 x86_64         1.3.216.0-1.el8_6            appstream          138 k
 xcb-util-image                x86_64         0.4.0-9.el8                  appstream           20 k
 xcb-util-keysyms              x86_64         0.4.0-7.el8                  appstream           15 k
 xcb-util-renderutil           x86_64         0.3.9-10.el8                 appstream           18 k
 xcb-util-wm                   x86_64         0.4.1-12.el8                 appstream           31 k

Transaction Summary
====================================================================================================
Install  14 Packages

Total download size: 110 M
Installed size: 267 M
Is this ok [y/N]: y
Downloading Packages:
(1/14): qt5-qtbase-common-5.15.2-4.el8.noarch.rpm                   237 kB/s |  40 kB     00:00    
(2/14): qt5-qtbase-5.15.2-4.el8.x86_64.rpm                          2.3 MB/s | 3.6 MB     00:01    
(3/14): qt5-qttools-common-5.15.2-4.el8.0.1.noarch.rpm              436 kB/s |  20 kB     00:00    
(4/14): qt5-qttools-libs-help-5.15.2-4.el8.0.1.x86_64.rpm           1.5 MB/s | 193 kB     00:00    
(5/14): qt5-qtx11extras-5.15.2-2.el8.0.1.x86_64.rpm                 541 kB/s |  39 kB     00:00    
(6/14): vulkan-loader-1.3.216.0-1.el8_6.x86_64.rpm                  1.2 MB/s | 138 kB     00:00    
(7/14): xcb-util-image-0.4.0-9.el8.x86_64.rpm                       293 kB/s |  20 kB     00:00    
(8/14): xcb-util-keysyms-0.4.0-7.el8.x86_64.rpm                     220 kB/s |  15 kB     00:00    
(9/14): xcb-util-renderutil-0.3.9-10.el8.x86_64.rpm                 240 kB/s |  18 kB     00:00    

(10/14): xcb-util-wm-0.4.1-12.el8.x86_64.rpm                        462 kB/s |  31 kB     00:00    
(11/14): pcre2-utf16-10.32-3.el8_6.x86_64.rpm                       1.2 MB/s | 228 kB     00:00    
(12/14): mesa-vulkan-drivers-21.3.4-1.el8.x86_64.rpm                2.6 MB/s | 6.7 MB     00:02    
(13/14): qt5-qtbase-gui-5.15.2-4.el8.x86_64.rpm                     2.1 MB/s | 6.1 MB     00:02    
(14/14): VirtualBox-7.0-7.0.2_154219_el8-1.x86_64.rpm               5.8 MB/s |  93 MB     00:16    
----------------------------------------------------------------------------------------------------
Total                                                               5.6 MB/s | 110 MB     00:19     
Oracle Linux / RHEL / CentOS-8 / x86_64 - VirtualBox                1.6 kB/s | 1.7 kB     00:01    
Importing GPG key 0x98AB5139:
 Userid     : "Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>"
 Fingerprint: 7B0F AB3A 13B9 0743 5925 D9C9 5442 2A4B 98AB 5139
 From       : https://www.virtualbox.org/download/oracle_vbox.asc
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                            1/1 

Installed:
  VirtualBox-7.0-7.0.2_154219_el8-1.x86_64        mesa-vulkan-drivers-21.3.4-1.el8.x86_64           
  pcre2-utf16-10.32-3.el8_6.x86_64                qt5-qtbase-5.15.2-4.el8.x86_64                    
  qt5-qtbase-common-5.15.2-4.el8.noarch           qt5-qtbase-gui-5.15.2-4.el8.x86_64                
  qt5-qttools-common-5.15.2-4.el8.0.1.noarch      qt5-qttools-libs-help-5.15.2-4.el8.0.1.x86_64     
  qt5-qtx11extras-5.15.2-2.el8.0.1.x86_64         vulkan-loader-1.3.216.0-1.el8_6.x86_64            
  xcb-util-image-0.4.0-9.el8.x86_64               xcb-util-keysyms-0.4.0-7.el8.x86_64           
    
  xcb-util-renderutil-0.3.9-10.el8.x86_64         xcb-util-wm-0.4.1-12.el8.x86_64                   

Complete!

Step 7: Download virtual box by using the wget command

[root@linuxhelp ~]# wget https://download.virtualbox.org/virtualbox/7.0.0/Oracle_VM_VirtualBox_Extension_Pack-7.0.0.vbox-extpack
--2022-10-28 04:20:56--  https://download.virtualbox.org/virtualbox/7.0.0/Oracle_VM_VirtualBox_Extension_Pack-7.0.0.vbox-extpack
Resolving download.virtualbox.org (download.virtualbox.org)... 23.200.48.100
Connecting to download.virtualbox.org (download.virtualbox.org)|23.200.48.100|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18487641 (18M) [text/plain]
Saving to: ‘Oracle_VM_VirtualBox_Extension_Pack-7.0.0.vbox-extpack’

Oracle_VM_VirtualBox_Ext 100%[==================================>]  17.63M  4.72MB/s    in 4.2s    

2022-10-28 04:21:03 (4.21 MB/s) - ‘Oracle_VM_VirtualBox_Extension_Pack-7.0.0.vbox-extpack’ saved [18487641/18487641]

[root@linuxhelp ~]# sudo /sbin/vboxconfig 
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-4.18.0-372.9.1.el8.x86_64
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.

The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-4.18.0-372.9.1.el8.x86_64

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.

Step 8: Install oracle virtual box license key and extension pack by using the below command

[root@linuxhelp ~]# VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-*.vbox-extpack
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.18.0-372.9.1.el8.x86_64) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /sbin/vboxconfig

         You will not be able to start VMs until this problem is fixed.
VirtualBox Extension Pack Personal Use and Evaluation License (PUEL)

License version 11, 21 May 2020

PLEASE READ THE FOLLOWING ORACLE VM VIRTUALBOX EXTENSION PACK PERSONAL
USE AND EVALUATION LICENSE CAREFULLY BEFORE DOWNLOADING OR USING THE
ORACLE SOFTWARE. THESE TERMS AND CONDITIONS CONSTITUTE A LEGAL AGREEMENT
BETWEEN YOU AND ORACLE.

ORACLE AMERICA, INC. ("ORACLE") IS WILLING TO LICENSE THE PRODUCT DEFINED
IN SECTION 1 BELOW ONLY ON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS
CONTAINED IN THIS VIRTUALBOX EXTENSION PACK PERSONAL USE AND EVALUATION

LICENSE AGREEMENT ("AGREEMENT").

IF YOU ARE AGREEING TO THIS LICENSE ON BEHALF OF AN ENTITY (RATHER THAN
AS AN INDIVIDUAL HUMAN BEING), YOU REPRESENT THAT YOU HAVE THE APPROPRIATE
AUTHORITY TO ACCEPT THESE TERMS AND CONDITIONS ON BEHALF OF SUCH ENTITY.

1 SUBJECT OF AGREEMENT. This Agreement governs your use of the binary
software package called "Oracle VM VirtualBox Extension Pack" (the
"Product"), which contains a set of additional features for "Oracle
VM VirtualBox" that enhance the operation of multiple virtual machines
("Guest Computers") on a single physical computer ("Host Computer"). The
Product consists of executable files in machine code, script files,
data files, and all documentation and updates provided to You by Oracle.

2 GRANT OF LICENSE. Oracle grants you a personal, non-exclusive,
non-transferable, limited license without fees to reproduce, install,
execute, and use internally the Product on Host Computers for
your Personal Use, Educational Use, or Evaluation. "Personal Use"
is noncommercial use solely by the person downloading the Product
from Oracle on a single Host Computer, provided that no more than one
client or remote computer is connected to that Host Computer and that
client or remote computer is used solely to remotely view the Guest
Computer(s). "Educational Use" is any use by teachers or students in
an academic institution (schools, colleges and universities) as part of
the institution's educational curriculum. "Evaluation" means testing the
Product for up to thirty (30) days; after expiry of that term, you are
no longer permitted to use the Product. Personal Use and/or Educational
Use expressly exclude any use of the Product for commercial purposes or
to operate, run, or act on behalf of or for the benefit of a business,
organization, governmental organization, or educational institution.

Oracle reserves all rights not expressly granted in this license.

3 RESTRICTIONS AND RESERVATION OF RIGHTS.

(1) The Product and copies thereof provided to you under this Agreement
are copyrighted and licensed, not sold, to you by Oracle.

(2) You may not do any of the following: (a) modify any part of the
Product, except to the extent allowed in the documentation accompanying
the Product; (b) rent, lease, lend, re-distribute, or encumber the
Product; (c) remove or alter any proprietary legends or notices contained
in the Product; or (d) decompile, or reverse engineer the Product
(except to the extent permitted by applicable law).

(3) The Product is not designed, licensed or intended for use in the
design, construction, operation or maintenance of any nuclear facility
and Oracle and its licensors disclaim any express or implied warranty
of fitness for such uses.

(4) No right, title or interest in or to any trademark, service mark, logo
or trade name of Oracle or its licensors is granted under this Agreement.

4 TERMINATION. The Agreement is effective on the date you receive the
Product and remains effective until terminated. Your rights under this
Agreement will terminate immediately without notice from Oracle if
you materially breach it or take any action in derogation of Oracle's
and/or its licensors' rights to the Product. Oracle may terminate this
Agreement immediately should any part of the Product become or in Oracle's
reasonable opinion likely to become the subject of a claim of intellectual
property infringement or trade secret misappropriation. Upon termination,
you will cease use of and destroy all copies of the Product under your
control and confirm compliance in writing to Oracle. Neither termination
of this Agreement nor any deletion or removal of the Product shall limit
any obligations you may have to Oracle, or any rights and/or remedies that
Oracle may have with respect to any past or future infringing use of the
Product (including but not limited to any use of the Product outside the
scope of the license provided in the Agreement). Sections 3-9, inclusive,
will survive termination of the Agreement.

5 DISCLAIMER OF WARRANTY. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW,
ORACLE PROVIDES THE PRODUCT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED. WITHOUT LIMITING THE FOREGOING, ORACLE SPECIFICALLY
DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. The entire risk as
to the quality and performance of the Product is with you. Should it
prove defective, you assume the cost of all necessary servicing, repair,
or correction.

6 LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW,
IN NO EVENT WILL ORACLE OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
PROFIT, DATA, OR DATA USE, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL,
INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY
OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO
USE THE PRODUCT, EVEN IF ORACLE HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES. In no event will Oracle's liability to you, whether in
contract, tort (including negligence), or otherwise, exceed the amount
paid by you for the Product under this Agreement.

7 SEPARATELY LICENSED THIRD PARTY TECHNOLOGY. The Product may contain
or require the use of third party technology that is provided with
the Product. Oracle may provide certain notices to you in the Product's
documentation, readmes or notice files in connection with such third party
technology. Third party technology will be licensed to you either under
the terms of this Agreement or, if specified in the documentation, readmes
or notice files, under Separate Terms. Your rights to use Separately
Licensed Third Party Technology under Separate Terms are not restricted
in any way by this Agreement. However, for clarity, notwithstanding the
existence of a notice, third party technology that is not Separately
Licensed Third Party Technology shall be deemed part of the Product and
is licensed to You under the terms of this Agreement. "Separate Terms"
refers to separate license terms that are specified in the Product's
documentation, readmes or notice files and that apply to Separately
Licensed Third Party Technology. "Separately Licensed Third Party
Technology" refers to third party technology that is licensed under
Separate Terms and not under the terms of this Agreement.

8 EXPORT. Export laws and regulations of the United States and any other
relevant local export laws and regulations apply to the Product. You
agree that such export laws govern your use of the Product (including
technical data) provided under this Agreement, and you agree to comply
with all such export laws and regulations (including "deemed export" and
"deemed re-export" regulations). You agree that no data, information,
and/or Product (or direct product thereof) will be exported, directly or
indirectly, in violation of these laws, or will be used for any purpose
prohibited by these laws including, without limitation, nuclear, chemical,
or biological weapons proliferation, or development of missile technology.

9 U.S. GOVERNMENT END USERS. Oracle programs, including the Product,
any operating system, integrated software, any programs installed on
hardware, and/or documentation, delivered to U.S. Government end users
are "commercial computer software" pursuant to the applicable Federal
Acquisition Regulation and agency-specific supplemental regulations. As
such, use, duplication, disclosure, modification, and adaptation of
the programs, including any operating system, integrated software,
any programs installed on the hardware, and/or documentation, shall
be subject to license terms and license restrictions applicable to the
programs. No other rights are granted to the U.S. Government.

10 MISCELLANEOUS. This Agreement is the entire agreement between you
and Oracle relating to its subject matter. It supersedes all prior or
contemporaneous oral or written communications, proposals, representations
and warranties and prevails over any conflicting or additional terms
of any quote, order, acknowledgment, or other communication between
the parties relating to its subject matter during the term of this
Agreement. No modification of this Agreement will be binding, unless in
writing and signed by an authorized representative of each party. If any
provision of this Agreement is held to be unenforceable, this Agreement
will remain in effect with the provision omitted, unless omission would
frustrate the intent of the parties, in which case this Agreement will
immediately terminate. This Agreement is governed by the laws of the
State of California, USA, and you and Oracle agree to submit to the
exclusive jurisdiction of, and venue in, the courts of San Francisco
or Santa Clara counties in California in any dispute arising out of or
relating to this Agreement. Upon 45 days written notice, Oracle may
audit your use of the Product to confirm that you are in compliance
with the terms of this Agreement. You agree to cooperate with Oracle's
audit and provide reasonable assistance and access to information. Any
such audit shall not unreasonably interfere with your normal business
operations. You agree to pay within 30 days of written notification
any fees applicable to your unlicensed use of the Product. You agree
that Oracle shall not be responsible for any of your costs incurred in
cooperating with the audit. If a legal action or proceeding is commenced


by either party in connection with the enforcement of this Agreement,
the prevailing party shall be entitled to its costs and attorneys'
fees actually incurred in connection with such action or proceeding.

Do you agree to these license terms and conditions (y/n)? y

License accepted. For batch installation add
--accept-license=33d7284dc4a0ece381196fda3cfe2ed0e1e8e7ed7f27b9a9ebc4ee22e24bd23c
to the VBoxManage command line.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully installed "Oracle VM VirtualBox Extension Pack".

Step 9: Finally run the virtual box by using the below command

[root@linuxhelp ~]# virtualbox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.18.0-372.9.1.el8.x86_64) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /sbin/vboxconfig

         You will not be able to start VMs until this problem is fixed.

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to installing the Virtual Box in Rocky Linux 8.6. Your feedback is much welcome.

FAQ
Q
Can VirtualBox damage your PC?
A
In general, using a virtual machine will not cause any problems.
Q
Is VirtualBox safe?
A
Yes, VirtualBox is safe to use on any supported platform.
Q
Why is VirtualBox free?
A
Released under the terms of the GNU General Public License and, optionally, the CDDL for most files of the source distribution.
Q
Is VM VirtualBox free?
A
A powerful, open-source, virtual machine platform. To get started on your virtualization journey, VM VirtualBox offers a free virtual machine license for personal, educational, or evaluation use.
Q
Which is faster VirtualBox or VMware?
A
VMware's virtual machines run faster than their VirtualBox counterparts.