Learn how to install VirtualBox on Rocky Linux 9 with our comprehensive step-by-step guide. Enable seamless virtualization and run multiple operating systems on your Linux environment with ease. #centlinux #linux #virtualbox
VirtualBox is an open-source virtualization software developed by Oracle that allows you to run multiple operating systems (OS) simultaneously on a single physical machine. It creates virtual machines (VMs) that emulate a complete hardware environment, enabling you to install and run different OSes in isolation from each other and from the host operating system. Here are some key features and uses of VirtualBox:
VirtualBox is widely used for software development, testing, and education because it provides an easy way to run multiple OSes on a single machine without the need for additional hardware. It’s a valuable tool for developers who need to test their applications on different platforms, IT professionals managing multiple environments, and anyone interested in learning about or using different operating systems.
VirtualBox Guest Additions are a suite of software drivers and utilities that can be installed inside a virtual machine (VM) running on VirtualBox to improve the integration and performance of the guest operating system. Here are the key features and benefits of installing Guest Additions:
Recommended Online Training: Mastering VirtualBox and Network Virtualization
We are using a minimal Rocky Linux 9 virtual machine with following specifications.
Read Also: How to install VirtualBox on CentOS 7
By using a ssh client, connect with your Rocky Linux 9 server as root user.
By executing lscpu command, you can easily verify that, Is your CPU is supporting virtualization or not?
# lscpu | grep Virtualization Virtualization: VT-x Virtualization type: full
If you get the above output, then it means that your CPU supports virtualization and you can setup a VirtualBox virtualization host thereon.
However, if the above command returns no result on your server then:
By using hostnamectl command, set the hostname of your Linux server.
# hostnamectl set-hostname virtualbox-01.centlinux.com
Refresh cache of your enabled yum repositories with the help of dnf command.
# dnf makecache --refresh Rocky Linux 9 - BaseOS 376 kB/s | 1.7 MB 00:04 Rocky Linux 9 - AppStream 398 kB/s | 6.0 MB 00:15 Rocky Linux 9 - Extras 1.5 kB/s | 2.9 kB 00:01 Metadata cache created.
Now, execute following command to update your Linux software packages.
# dnf update -y
The above command may also updates your Linux Kernel. In this case, you should reboot your operating system with the new Linux Kernel.
# reboot
Check the versions of your Linux operating system and Kernel as follows.
# cat /etc/rocky-release Rocky Linux release 9.0 (Blue Onyx) # uname -r 5.14.0-70.26.1.el9_0.x86_64
Some required packages of VirtualBox software are not available in Standard yum repositories.
Therefore, you need to install EPEL (Extra Packages for Enterprise Linux) yum repository.
# dnf install -y epel-release
VirtualBox RPM packages are available at https://www.virtualbox.org/wiki/Linux_Downloads.
Besides that Vendor also provides an official yum repository for Red Hat based Linux distros.
You can download virtualbox.repo file and place it in /etc/yum.repos.d directory for immediate addition to dnf repolist.
# wget https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo --2022-10-28 21:46:47-- https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo Resolving download.virtualbox.org (download.virtualbox.org)... 23.36.48.85 Connecting to download.virtualbox.org (download.virtualbox.org)|23.36.48.85|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 259 [text/plain] Saving to: ‘/etc/yum.repos.d/virtualbox.repo’ /etc/yum.repos.d/vi 100%[===================>] 259 --.-KB/s in 0s 2022-10-28 21:46:49 (875 KB/s) - ‘/etc/yum.repos.d/virtualbox.repo’ saved [259/259]
You have added new yum repositories, therefore, you should rebuild your yum cache now.
# dnf makecache Extra Packages for Enterprise Linux 9 - x86_64 658 kB/s | 11 MB 00:16 Rocky Linux 9 - BaseOS 990 B/s | 3.6 kB 00:03 Rocky Linux 9 - AppStream 1.9 kB/s | 3.6 kB 00:01 Rocky Linux 9 - Extras 873 B/s | 2.9 kB 00:03 Oracle Linux / RHEL / CentOS-9 / x86_64 - Virtu 174 B/s | 181 B 00:01 Oracle Linux / RHEL / CentOS-9 / x86_64 - Virtu 1.3 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 Oracle Linux / RHEL / CentOS-9 / x86_64 - Virtu 36 kB/s | 33 kB 00:00 Metadata cache created.
You have successfully setup required yum repositories on your Rocky Linux server. Therefore, you can now easily install all VirtualBox prerequisites by executing a single dnf command.
# dnf -y install kernel-devel kernel-headers glibc-headers glibc-devel binutils libgomp make patch gcc dkms
Search for the available versions of VirtualBox by using dnf command.
# dnf search virtualbox Last metadata expiration check: 0:07:29 ago on Fri 28 Oct 2022 09:49:34 PM CDT. ====================== Name & Summary Matched: virtualbox ====================== VirtualBox-6.1.x86_64 : Oracle VM VirtualBox VirtualBox-7.0.x86_64 : Oracle VM VirtualBox
You can now install VirtualBox 7.0 on your Linux server by executing following command.
# dnf install -y VirtualBox-7.0
The VirtualBox installation process creates a systemd unit vboxdrv.service.
Check the status of vboxdrv.service.
# systemctl status vboxdrv.service
● vboxdrv.service - VirtualBox Linux kernel module
Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled; vendor preset: di>
Active: active (exited) since Fri 2022-10-28 22:07:30 CDT; 2min 12s ago
Process: 718 ExecStart=/usr/lib/virtualbox/vboxdrv.sh start (code=exited, s>
CPU: 30.588s
Oct 28 22:06:35 virtualbox-01.centlinux.com systemd[1]: Starting VirtualBox Lin>
Oct 28 22:07:11 virtualbox-01.centlinux.com vboxdrv.sh[718]: vboxdrv.sh: Starti>
Oct 28 22:07:30 virtualbox-01.centlinux.com vboxdrv.sh[899]: VirtualBox service>
Oct 28 22:07:30 virtualbox-01.centlinux.com systemd[1]: Started VirtualBox Linu>
VirtualBox 7.0 has been successfully installed on your Rocky Linux 9 machine.
VirtualBox extension pack extends the VirtualBox support for VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards.
You can download VirtualBox 7.0 Extension Pack for your preferred Linux distribution from VirtualBox website.
Alternatively, you can use wget command to download VirtualBox Extension Pack direct from Linux commandline.
# cd /tmp # wget https://download.virtualbox.org/virtualbox/7.0.2/Oracle_VM_VirtualBox_Extension_Pack-7.0.2.vbox-extpack --2022-10-28 22:12:52-- https://download.virtualbox.org/virtualbox/7.0.2/Oracle_VM_VirtualBox_Extension_Pack-7.0.2.vbox-extpack Resolving download.virtualbox.org (download.virtualbox.org)... 104.119.104.89 Connecting to download.virtualbox.org (download.virtualbox.org)|104.119.104.89|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 18515967 (18M) [text/plain] Saving to: ‘Oracle_VM_VirtualBox_Extension_Pack-7.0.2.vbox-extpack’ Oracle_VM_VirtualBo 100%[===================>] 17.66M 1.22MB/s in 15s 2022-10-28 22:13:08 (1.19 MB/s) - ‘Oracle_VM_VirtualBox_Extension_Pack-7.0.2.vbox-extpack’ saved [18515967/18515967]
Now, install VirtualBox extension pack by executing following Linux command.
# VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.2.vbox-extpack
VirtualBox Extension Pack Personal Use and Evaluation License (PUEL)
<VirtualBox License Agreement>
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".
VirtualBox 7.0 Extension Pack has been installed on your Rocky Linux server.
Although, it is quiet convenient to use VirtualBox in a Graphical User Interface (GUI). But you can also manage your VirtualBox environment on a headless server from Linux commandline (CLI). For this purpose, VirtualBox provides a set of commands prefixed with vbox*.
Congratulations on successfully learn how to install VirtualBox on Rocky Linux 9! With VirtualBox up and running, you can now create and manage virtual machines, allowing you to run multiple operating systems simultaneously on your Linux environment. This setup enhances your flexibility for testing, development, and running different applications. Embrace the power of virtualization and take your productivity to the next level. Happy virtualizing! If you want to learn more about Oracle VirtualBox, then you should read VirtualBox Made Easy: Virtualize Your Environment with Ease (Computers Made Easy) (PAID LINK)by James Bernstein.
Puppy Linux is a fast, lightweight OS designed for speed and simplicity, perfect for old…
Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…
Discover how to change Apache port in Linux easily. Follow our simple guide to modify…
Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…
Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…
Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…
This website uses cookies.
View Comments
I have an error because `modprobe vboxdrv` failed.
The command you are executing is not mentioned in above tutorial. Therefore, there isn't any need to execute this command.