How To Install VirtualBox on AlmaLinux 10
VirtualBox stands as one of the most popular open-source virtualization platforms, enabling users to run multiple operating systems simultaneously on a single machine. When combined with AlmaLinux 10, an enterprise-grade Linux distribution that serves as a community-driven RHEL alternative, VirtualBox creates a powerful virtualization environment perfect for development, testing, and production scenarios.
This comprehensive guide walks you through the complete VirtualBox installation process on AlmaLinux 10, from initial system preparation to advanced configuration. Whether you’re a system administrator managing enterprise environments, a developer requiring isolated testing environments, or an IT professional exploring virtualization technologies, this tutorial provides everything needed to successfully deploy VirtualBox on your AlmaLinux 10 system.
The installation process involves several critical steps including system preparation, repository configuration, package installation, and post-installation optimization. Each step requires careful attention to ensure optimal performance and security. By following this guide, you’ll establish a robust virtualization platform capable of supporting various operating systems and applications.
Prerequisites and System Requirements
Hardware Requirements
Before installing VirtualBox on AlmaLinux 10, verify that your system meets the minimum hardware specifications. Your machine requires at least 4GB of RAM, though 8GB or more is recommended for running multiple virtual machines simultaneously. The processor must support 64-bit architecture with hardware virtualization extensions (Intel VT-x or AMD-V).
Storage requirements depend on your intended usage, but allocate at least 50GB of free disk space for the VirtualBox installation and initial virtual machines. High-performance storage solutions like SSDs significantly improve VM performance compared to traditional hard drives.
The CPU should support virtualization technology, which most modern processors include by default. However, this feature might be disabled in BIOS/UEFI settings and requires manual activation.
Software Prerequisites
Your AlmaLinux 10 system must be properly installed and configured with administrative privileges. Ensure you have sudo access or root permissions to install packages and modify system configurations. A stable internet connection is essential for downloading VirtualBox packages and dependencies.
The system should run the latest available kernel version to avoid compatibility issues with VirtualBox kernel modules. Outdated kernels often cause installation failures or runtime problems that require additional troubleshooting.
Terminal access is required throughout the installation process, whether through local console access or remote SSH connections. Familiarity with basic Linux command-line operations will facilitate the installation process.
Virtualization Technology Verification
Before proceeding with VirtualBox installation, verify that your processor supports hardware virtualization. Execute the following command to check for virtualization extensions:
grep -E "vmx|svm" /proc/cpuinfo
If this command returns output containing “vmx” (Intel) or “svm” (AMD), your processor supports virtualization. Empty output indicates either lack of support or disabled virtualization in BIOS settings.
Access your system’s BIOS or UEFI configuration during startup and locate virtualization settings. These options might be labeled as “Intel VT-x,” “AMD-V,” “Virtualization Technology,” or similar terminology. Enable these features and save the configuration before proceeding.
Preparing the AlmaLinux 10 System
System Update
Maintaining an updated AlmaLinux 10 system is crucial for VirtualBox compatibility and security. Begin by updating the package repositories and installing the latest available packages:
sudo dnf update -y
This command downloads and installs all available updates, including kernel updates, security patches, and package improvements. The update process might take several minutes depending on the number of available updates and your internet connection speed.
After completing the update process, check the current kernel version to ensure you’re running the latest available kernel:
uname -r
Note the kernel version for later verification during the development tools installation process.
Installing Development Tools
VirtualBox requires specific development tools and kernel headers to compile kernel modules successfully. Install the EPEL repository first, as it provides additional packages not available in the standard AlmaLinux repositories:
sudo dnf install -y epel-release
Install the essential development tools required for VirtualBox kernel module compilation:
sudo dnf groupinstall -y "Development Tools"
sudo dnf install -y kernel-devel kernel-headers gcc make perl elfutils-libelf-devel
The “Development Tools” group package includes GCC compiler, make utility, and other essential build tools. Individual packages like kernel-devel and kernel-headers provide the necessary kernel source files for module compilation.
Verify that the installed kernel-devel package matches your running kernel version:
rpm -q kernel-devel
uname -r
Both commands should return the same version number. Mismatched versions prevent successful VirtualBox installation and require resolution before proceeding.
Kernel Verification and Resolution
Version mismatches between the running kernel and kernel-devel packages commonly occur after partial system updates. If versions don’t match, install the correct kernel-devel package:
sudo dnf install -y kernel-devel-$(uname -r)
Some situations might require system reboot to load the latest kernel before installing development packages. After installing kernel updates, reboot the system and verify kernel versions again:
sudo reboot
Following the reboot, repeat the kernel verification process to ensure consistency between running kernel and development packages.
Adding VirtualBox Official Repository
Repository Configuration Process
Oracle provides official VirtualBox repositories for various Linux distributions, including AlmaLinux 10. Adding the official repository ensures access to the latest VirtualBox versions and automatic updates through the standard package manager.
Create the VirtualBox repository configuration file:
sudo tee /etc/yum.repos.d/virtualbox.repo << 'EOF'
[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=https://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
EOF
This configuration enables the VirtualBox repository with GPG signature verification for enhanced security. The repository URL automatically adjusts based on your system’s architecture and AlmaLinux version.
Import the Oracle VirtualBox GPG signing key to verify package authenticity:
sudo rpm --import https://www.virtualbox.org/download/oracle_vbox.asc
Successful key import enables DNF to verify VirtualBox package signatures during installation, preventing installation of modified or corrupted packages.
Repository Verification
Verify the repository configuration by listing available VirtualBox packages:
dnf search virtualbox
This command should display available VirtualBox packages from the newly added repository. If no packages appear, check the repository configuration for syntax errors or network connectivity issues.
Update the package cache to ensure DNF recognizes the new repository:
sudo dnf makecache
The cache update process downloads package metadata from all configured repositories, including the newly added VirtualBox repository.
Installing VirtualBox on AlmaLinux 10
Core Installation Process
With repositories properly configured and system prepared, proceed with the actual VirtualBox installation. Multiple VirtualBox versions might be available; select the latest stable release for optimal compatibility:
sudo dnf install -y VirtualBox-7.0
The installation process downloads the VirtualBox package and automatically resolves dependencies. Accept the Oracle GPG key when prompted to verify package authenticity.
During installation, DNF might prompt for GPG key acceptance. Verify the key fingerprint matches Oracle’s official key before accepting:
Public key for VirtualBox-7.0-7.0.x_x.el9.x86_64.rpm is not installed
Type “y” to accept the key and continue installation.
Kernel Module Configuration
VirtualBox requires kernel modules to interface with the host system’s virtualization features. Configure and start the VirtualBox kernel module service:
sudo systemctl enable vboxdrv
sudo systemctl start vboxdrv
Check the service status to ensure successful initialization:
sudo systemctl status vboxdrv
Active service status indicates successful kernel module loading. Failed status usually indicates kernel module compilation errors requiring troubleshooting.
Manually rebuild VirtualBox kernel modules if automatic compilation fails:
sudo /sbin/vboxconfig
This command recompiles VirtualBox kernel modules using the current kernel sources and development tools.
User Permission Configuration
VirtualBox requires specific user permissions to access virtualization features and USB devices. Add your user account to the vboxusers
group:
sudo usermod -aG vboxusers $USER
Log out and log back in for group membership changes to take effect. Alternatively, start a new shell session with updated group permissions:
newgrp vboxusers
Verify group membership using the groups
command:
groups
The output should include vboxusers
among the listed groups.
Installing VirtualBox Extension Pack
Extension Pack Benefits
The VirtualBox Extension Pack provides additional functionality not included in the base installation. Key features include USB 2.0 and 3.0 support, remote desktop protocol (RDP) server capabilities, host webcam passthrough, and Intel PXE boot ROM support.
These features are essential for enterprise environments and advanced virtualization scenarios. The Extension Pack is free for personal use but requires commercial licensing for business environments.
Download and Installation Process
Download the Extension Pack directly from Oracle’s official website or use wget:
cd /tmp
wget https://download.virtualbox.org/virtualbox/7.0.x/Oracle_VM_VirtualBox_Extension_Pack-7.0.x.vbox-extpack
Replace “7.0.x” with the exact version number matching your VirtualBox installation. Version mismatches prevent successful Extension Pack installation.
Install the Extension Pack using VirtualBox’s command-line management tool:
sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.x.vbox-extpack
The installation process displays the Extension Pack license agreement. Read the terms carefully and type “y” to accept the license and proceed with installation.
Installation Verification
Confirm successful Extension Pack installation:
vboxmanage list extpacks
This command displays installed Extension Packs with version information and enabled status. Successful installation shows the Oracle VM VirtualBox Extension Pack as “Usable: true.”
Post-Installation Configuration
Network Configuration Optimization
VirtualBox supports multiple networking modes, each serving different virtualization scenarios. Configure host-only networking for isolated VM communication:
vboxmanage hostonlyif create
This command creates a host-only network adapter enabling communication between the host system and virtual machines without external network access.
Configure firewall rules to allow VirtualBox network traffic if using bridged or NAT networking modes. AlmaLinux 10 includes firewalld by default:
sudo firewall-cmd --permanent --add-service=virtualbox
sudo firewall-cmd --reload
These commands create permanent firewall rules allowing VirtualBox network traffic and reload the firewall configuration.
Storage Management Configuration
Configure default virtual machine storage locations to optimize disk usage and performance. Create a dedicated directory for virtual machine files:
mkdir -p ~/VirtualBox\ VMs
Set this directory as the default machine folder in VirtualBox:
vboxmanage setproperty machinefolder ~/VirtualBox\ VMs
This configuration centralizes virtual machine files and simplifies backup and management procedures.
Performance Tuning Parameters
Optimize VirtualBox performance by configuring appropriate resource allocation settings. Set reasonable default memory and CPU allocations based on your host system specifications.
For systems with 8GB RAM, allocate no more than 50-60% to virtual machines simultaneously. CPU allocation should leave at least one core available for the host system to maintain responsiveness.
Enable hardware acceleration features when supported by your processor:
vboxmanage modifyvm "VM_NAME" --hwvirtex on
vboxmanage modifyvm "VM_NAME" --vtxvpid on
vboxmanage modifyvm "VM_NAME" --largepages on
These settings enable Intel VT-x extensions, VPID support, and large page memory allocation for improved performance.
Creating Your First Virtual Machine
Virtual Machine Creation Wizard
Launch VirtualBox GUI to begin creating virtual machines:
virtualbox
The VirtualBox Manager window provides graphical interface for virtual machine creation and management. Click “New” to start the virtual machine creation wizard.
Specify virtual machine details including name, operating system type, and version. The name determines the virtual machine folder name and identification within VirtualBox. Choose the correct operating system type for optimal compatibility and performance.
Memory allocation depends on the guest operating system requirements and available host memory. Modern operating systems typically require 2-4GB RAM minimum, while older systems may function with 1-2GB.
Storage Configuration Options
Configure virtual hard disk storage during the creation process. VirtualBox supports multiple disk formats including VDI (VirtualBox Disk Image), VMDK (Virtual Machine Disk), and VHD (Virtual Hard Disk).
VDI format provides the best integration with VirtualBox features and optimal performance. VMDK format offers compatibility with VMware products, while VHD format supports Microsoft virtualization platforms.
Choose between dynamically allocated and fixed-size storage. Dynamic allocation starts with minimal disk usage and grows as needed, while fixed-size allocation reserves the full disk space immediately but provides better performance.
Installation Media Configuration
Attach installation media to complete the virtual machine setup. VirtualBox supports ISO image files, physical optical drives, and network-based installation sources.
Download the desired operating system installation media and attach it to the virtual machine’s optical drive:
vboxmanage storageattach "VM_NAME" --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /path/to/installation.iso
Configure boot order to prioritize optical drive during initial startup, allowing the virtual machine to boot from installation media.
Advanced VirtualBox Features
Snapshot Management Capabilities
VirtualBox snapshots capture complete virtual machine states, including memory contents, disk data, and configuration settings. Snapshots enable quick restoration to previous states for testing, development, and backup purposes.
Create snapshots before making significant changes to virtual machines:
vboxmanage snapshot "VM_NAME" take "Snapshot_Name" --description "Description of changes"
Restore virtual machines to previous snapshots when needed:
vboxmanage snapshot "VM_NAME" restore "Snapshot_Name"
Snapshot management requires careful planning as they consume additional storage space and can impact performance with excessive usage.
Import and Export Functionality
VirtualBox supports Open Virtualization Format (OVF) for virtual machine portability across different virtualization platforms. Export virtual machines as OVA (Open Virtualization Archive) files for distribution or backup:
vboxmanage export "VM_NAME" --output /path/to/exported_vm.ova
Import OVA files to create new virtual machines:
vboxmanage import /path/to/imported_vm.ova
This functionality facilitates virtual machine migration between different hosts and virtualization platforms.
Guest Additions Installation
Guest Additions enhance virtual machine performance and functionality by providing optimized drivers and additional features. Install Guest Additions after completing guest operating system installation.
Mount the Guest Additions ISO image within the virtual machine:
vboxmanage storageattach "VM_NAME" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /usr/share/virtualbox/VBoxGuestAdditions.iso
Boot the virtual machine and install Guest Additions from the mounted ISO image. Guest Additions enable features like shared folders, clipboard integration, and automatic display resolution adjustment.
Troubleshooting Common Issues
Installation Problems Resolution
Kernel module compilation failures represent the most common VirtualBox installation issues. These problems typically result from missing development tools, kernel version mismatches, or corrupted package installations.
Resolve compilation errors by ensuring kernel-devel packages match the running kernel version:
sudo dnf install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)
Rebuild VirtualBox kernel modules after resolving dependency issues:
sudo /sbin/vboxconfig
Repository access problems might occur due to network connectivity issues or incorrect repository configuration. Verify repository settings and test network connectivity to Oracle’s download servers.
Runtime Problem Solutions
Virtual machine startup failures often result from insufficient host resources, hardware virtualization being disabled, or conflicting software installations. Check system logs for specific error messages:
journalctl -u vboxdrv
Performance issues typically indicate inadequate resource allocation or missing hardware acceleration features. Monitor host system resource usage during virtual machine operation to identify bottlenecks.
USB device recognition problems require proper user permissions and USB filter configuration. Ensure the user belongs to the vboxusers group and configure USB filters for required devices.
Service and Permission Issues
VirtualBox service startup failures usually indicate kernel module loading problems or permission conflicts. Check service status and logs for detailed error information:
sudo systemctl status vboxdrv
journalctl -xe
SELinux policies might prevent VirtualBox operation in enforcing mode. Temporarily set SELinux to permissive mode for troubleshooting:
sudo setenforce 0
Permanent SELinux configuration changes require policy modifications or disabling SELinux entirely, though this reduces system security.
Security and Best Practices
Security Hardening Measures
Implement security best practices to protect both host system and virtual machines. Configure network isolation using host-only networking for sensitive virtual machines requiring limited network access.
Enable VirtualBox’s built-in security features including encrypted virtual machine storage and secure boot support. These features protect against unauthorized access and tampering.
Regular security updates are essential for maintaining secure virtualization environments. Enable automatic updates for both host system and virtual machine operating systems.
Performance Optimization Strategies
Monitor host system performance during virtual machine operation to identify resource constraints and optimization opportunities. Use system monitoring tools to track CPU usage, memory consumption, and disk I/O patterns.
Allocate resources conservatively, leaving sufficient capacity for host system operations. Overallocation leads to poor performance and system instability.
Consider hardware upgrades like additional RAM or SSD storage for demanding virtualization workloads. Proper hardware selection significantly impacts virtualization performance and user experience.
Congratulations! You have successfully installed VirtualBox. Thanks for using this tutorial for installing the VirtualBox virtualization on your AlmaLinux OS 10 system. For additional help or useful information, we recommend you check the official Oracle VirtualBox website.