This guide will go through how to install VirtualBox 7 on Rocky Linux. VirtualBox is a type-2 hypervisor for x86 virtualization that Oracle Corporation developed. It can be used in both commercial and private settings.
How to Install VirtualBox 7 on Rocky Linux
- Update your Rocky Linux system packages.
sudo dnf update
- Then enable the EPEL repo using the command below.
sudo dnf install epel-release -y
- Next, install the built tools using the following command.
sudo dnf install wget curl gcc make perl bzip2 dkms kernel-devel kernel-headers -y
- Update your system and reboot it to update the Linux kernel.
sudo dnf update -y && sudo reboot now
- Add VirtualBox repository using the following command.
sudo dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
- After adding the repo, install VirtualBox 7 using the following command.
sudo dnf install VirtualBox-7.0 -y
Sample output
Dependencies resolved. ===================================================================== Package Arch Version Repository Size ===================================================================== Installing: VirtualBox-7.0 x86_64 7.0.4_154605_el9-1 virtualbox 92 M Installing dependencies: pcre2-utf16 x86_64 10.37-5.el9_0 appstream 208 k qt5-qtbase x86_64 5.15.2-29.el9 appstream 3.6 M qt5-qtbase-common noarch 5.15.2-29.el9 appstream 12 k qt5-qtbase-gui x86_64 5.15.2-29.el9 appstream 6.3 M qt5-qttools-common noarch 5.15.2-11.el9 appstream 11 k qt5-qttools-libs-help x86_64 5.15.2-11.el9 appstream 155 k qt5-qtx11extras x86_64 5.15.2-6.el9 appstream 35 k xcb-util-image x86_64 0.4.0-19.el9 appstream 19 k xcb-util-keysyms x86_64 0.4.0-17.el9 appstream 14 k xcb-util-renderutil x86_64 0.3.9-20.el9 appstream 17 k xcb-util-wm x86_64 0.4.1-22.el9 appstream 31 k Transaction Summary ===================================================================== Install 12 Packages Total download size: 102 M Installed size: 237 M Downloading Packages: (1/12): xcb-util-keysyms-0.4.0-17.el 18 kB/s | 14 kB 00:00 (2/12): xcb-util-wm-0.4.1-22.el9.x86 27 kB/s | 31 kB 00:01 (3/12): pcre2-utf16-10.37-5.el9_0.x8 121 kB/s | 208 kB 00:01 (4/12): xcb-util-renderutil-0.3.9-20 16 kB/s | 17 kB 00:01 (5/12): xcb-util-image-0.4.0-19.el9. 18 kB/s | 19 kB 00:01 (6/12): qt5-qtx11extras-5.15.2-6.el9 43 kB/s | 35 kB 00:00 (7/12): qt5-qttools-libs-help-5.15.2 59 kB/s | 155 kB 00:02 (8/12): qt5-qttools-common-5.15.2-11 4.8 kB/s | 11 kB 00:02
- Next, download the VirtualBox extension pack using the command below.
wget https://download.virtualbox.org/virtualbox/7.0.0/Oracle_VM_VirtualBox_Extension_Pack-7.0.0.vbox-extpack
- Build the kernel modules.
sudo /sbin/vboxconfig
Sample output
vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: Building VirtualBox kernel modules.
- Install the VirtualBox extension pack using the command below.
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-*.vbox-extpack
Sample output
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. 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".
- Launch VirtualBox using the command below.
virtualbox
- You can also launch VirtualBox from the application menu as shown below.
- Sample VirtualBox interface.
- You have made it to the end of our article on how to install VirtualBox 7 on Rocky Linux.
Read more about VirtualBox
Other Tutorials
Disconnect Frozen/Hung SSH Session in Linux