How to Install VirtualBox on Ubuntu 24.04 LTS: Step-by-Step
Learn how to install virtualbox on ubuntu 24.04 LTS with Oracle repositories, Extension Pack, guest additions, Secure Boot signing, and user groups.

5 min read
Learn how to install virtualbox on ubuntu 24.04 LTS with Oracle repositories, Extension Pack, guest additions, Secure Boot signing, and user groups.
- Prerequisites and Supported Releases
- Step 1: Verifying Hardware Virtualization Support
- Step 2: Installing Kernel Headers and DKMS Dependencies
Oracle VM VirtualBox is a powerful, open-source x86 and AMD64/Intel64 desktop virtualization hypervisor (Type-2) used by software developers, system administrators, and security researchers worldwide.
VirtualBox enables you to execute multiple isolated guest operating systems—including various Linux distributions, Windows 10/11, and BSD variants—simultaneously on a single physical host without repartitioning hard drives.
While Ubuntu includes open-source VirtualBox packages in its universe repository, installing the latest release directly from Oracle's official repository ensures you receive the latest VirtualBox 7.0 improvements, such as full virtual TPM 2.0 emulation, Secure Boot support, and Direct3D 11 acceleration.
In this guide, we walk through how to install virtualbox on ubuntu 24.04 LTS step-by-step, install the Extension Pack, configure UEFI Secure Boot kernel signing, and add user permissions.
Comprehensive step-by-step administrator and developer guide on how to install Oracle VM VirtualBox 7.0 on Ubuntu 24.04 LTS (Noble Numbat). Covers verifying hardware virtualization extensions (VT-x/AMD-V), configuring Oracle's official APT repository using modern signed-by keyrings, installing kernel build headers and dkms modules, enrolling Machine Owner Keys (MOK) for UEFI Secure Boot, installing the VirtualBox Extension Pack, and configuring the vboxusers group for USB passthrough.
Prerequisites and Supported Releases
This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat) & Ubuntu 22.04 LTS. The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.
Before proceeding, ensure you have the following requirements satisfied:
- A computer or workstation running Ubuntu 24.04 LTS or Ubuntu 22.04 LTS with a graphical desktop.
- A 64-bit CPU supporting hardware virtualization (Intel VT-x or AMD-V) enabled in your BIOS/UEFI.
- A non-root user account with
sudoadministrative privileges. - At least 8 GB of RAM and 30 GB of free storage for hosting virtual machines.
Step 1: Verifying Hardware Virtualization Support
Before installing any hypervisor, ensure your computer's CPU supports hardware virtualization and that the feature is enabled in your motherboard's BIOS or UEFI settings.
Query your CPU flags using grep or install the cpu-checker utility:
If the output returns a count greater than 0, your CPU hardware supports virtualization:
# Check CPU hardware virtualization flags:
egrep -c '(vmx|svm)' /proc/cpuinfo
# Output > 0 confirms support (vmx = Intel, svm = AMD)
# Alternative check using cpu-checker:
sudo apt update && sudo apt install -y cpu-checker
kvm-ok
# Expected output confirms: INFO: /dev/kvm exists
# KVM acceleration can be used
Step 2: Installing Kernel Headers and DKMS Dependencies
VirtualBox compiles custom host kernel modules (such as vboxdrv, vboxnetflt, and vboxnetadp) to interact directly with host CPU and memory hardware.
Install Dynamic Kernel Module Support (dkms), GNU compiler tools, and the exact kernel header packages matching your active kernel:
DKMS ensures that whenever your Ubuntu system updates its Linux kernel, VirtualBox kernel modules are automatically rebuilt:
# Install essential build tools, dkms, and kernel headers:
sudo apt update
sudo apt install -y build-essential dkms linux-headers-$(uname -r)
Step 3: Adding the Official Oracle VirtualBox APT Repository
To install the latest official VirtualBox 7.0 release, configure Oracle's official APT repository using modern signed-by keyrings.
First, download and dearmor Oracle's public GPG signing key into /etc/apt/keyrings/:
Next, add the official repository source configuration file pointing to your Ubuntu release codename (noble for 24.04):
# Create keyrings directory:
sudo install -m 0755 -d /etc/apt/keyrings
# Download and dearmor Oracle public GPG key:
curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.gpg | \
sudo gpg --dearmor --yes -o /etc/apt/keyrings/virtualbox.gpg
sudo chmod a+r /etc/apt/keyrings/virtualbox.gpg
# Add the Oracle VirtualBox repository to APT sources:
echo \
"deb [arch=amd64 signed-by=/etc/apt/keyrings/virtualbox.gpg] https://download.virtualbox.org/virtualbox/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") contrib" | \
sudo tee /etc/apt/sources.list.d/virtualbox.list > /dev/null
# Refresh package cache:
sudo apt update
Step 4: Installing VirtualBox 7.0 on Ubuntu 24.04
With the official repository added and package index refreshed, install VirtualBox 7.0 via APT:
APT automatically downloads the application binaries, Qt GUI interface, and compiles the host kernel modules:
If your system uses UEFI Secure Boot, APT will prompt you to create a MOK (Machine Owner Key) password to sign the kernel modules.
# Install VirtualBox 7.0:
sudo apt install -y virtualbox-7.0
# Check kernel module status:
sudo systemctl status vboxdrv
# Output confirms: Active: active (exited) or running
Step 5: Installing the VirtualBox Extension Pack
The VirtualBox Extension Pack delivers vital proprietary functionality, including virtual USB 2.0/3.0 controller support, VirtualBox RDP remote desktop, disk encryption (AES), and Intel PXE boot ROMs.
Download the Extension Pack matching your exact installed VirtualBox version directly from Oracle:
Install the Extension Pack using the VBoxManage command-line utility:
# Detect installed VirtualBox version:
VBOX_VER=$(vboxmanage -v | cut -dr -f1)
# Download matching Extension Pack:
cd /tmp
wget "https://download.virtualbox.org/virtualbox/${VBOX_VER}/Oracle_VM_VirtualBox_Extension_Pack-${VBOX_VER}.vbox-extpack"
# Install the Extension Pack (accept license automatically with echo 'y'):
echo 'y' | sudo vboxmanage extpack install --replace "Oracle_VM_VirtualBox_Extension_Pack-${VBOX_VER}.vbox-extpack"
# Verify installed extension packs:
vboxmanage list extpacks
# Output confirms: Extension Packs: 1 ... Usable: true
Step 6: Adding Your User Account to the vboxusers Group
To allow virtual machines to attach USB devices directly from your physical host, your active user account must belong to the vboxusers system group.
Add your user account to the group using usermod:
Apply the group change immediately using newgrp or log out and log back in:
# Add current user to the vboxusers group:
sudo usermod -aG vboxusers $USER
# Apply group membership immediately without logging out:
newgrp vboxusers
# Launch VirtualBox from terminal or desktop:
virtualbox &
Troubleshooting and Common Errors
When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:
Kernel driver not installed (rc=-1908) / The VirtualBox Linux kernel driver is not loaded
Cause: The vboxdrv kernel module failed to compile or Secure Boot blocked unsigned third-party kernel modules.
Resolution: Recompile kernel modules using sudo /sbin/vboxconfig and enroll MOK key upon reboot if prompted.
sudo /sbin/vboxconfig
VT-x/AMD-V hardware acceleration is not available on your system
Cause: Hardware virtualization is disabled in your computer's BIOS/UEFI settings.
Resolution: Reboot your computer, enter BIOS/UEFI settings, and enable Intel Virtualization Technology (VT-x) or AMD SVM.
egrep -c '(vmx|svm)' /proc/cpuinfo
USB devices are greyed out or inaccessible inside guest OS
Cause: The active host user is not a member of the vboxusers group, or the Extension Pack is missing.
Resolution: Install the Extension Pack and run sudo usermod -aG vboxusers $USER followed by a reboot.
sudo usermod -aG vboxusers $USER
Security Best Practices and Hardening
The VirtualBox Extension Pack is licensed under the Personal Use and Evaluation License (PUEL); enterprise commercial deployments require an Oracle license.
Isolate untrusted guest virtual machines on a Host-Only or Internal Network adapter to prevent malicious guest code from scanning your local LAN.
Keep VirtualBox updated via APT to patch virtualization escape vulnerabilities.
Related Ubuntu Tutorials and Documentation
Deepen your Linux system administration skills with our related production-tested guides:
- How to Install Podman on Ubuntu: Rootless Container Alternative to Docker — Compare Type-2 hypervisors with lightweight rootless container runtimes.
- How to Install Docker on Ubuntu 24.04 — Set up container engines on Ubuntu for rapid application deployment.
- Initial Server Setup on Ubuntu 24.04 LTS — Foundational baseline setup for Ubuntu workstations and servers.
Authoritative References and Official Documentation

The Linux Command Line, 2nd Edition: A Complete Introduction
Frequently Asked Questions
Quick answers to common questions and configurations
sudo /media/$USER/VBox_GAs_*/VBoxLinuxAdditions.run.VBoxManage CLI command or remote web management tools like phpVirtualBox.VBoxManage startvm "VM_NAME" --type headless to launch the virtual machine silently in the background.Editorial Disclosure: Website Vidya is supported by our readers. When you purchase hosting, tools, or software through our verified partner links, we may earn an affiliate commission at no extra cost to you. We only recommend solutions we trust and rigorously verify.
Rajesh Ray
I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.
Most Read Guides
TrendingUbuntu Server Not Booting? 10 Simple Steps to Fix It Fast
How to Create a 3D Button in HTML and CSS: Easy Steps
How to Install Python and Pip on Ubuntu 24.04 LTS
How to Install Nginx on Ubuntu 24.04
How to Install Python on Ubuntu 24.04 LTS
Related Technical Guides
Tested runbooks, server administration walkthroughs, and troubleshooting guides


Join the Conversation & Perspective
Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.
No comments on this guide yet. Be the first to share your thoughts or ask a question!