Do you want to experiment with an obscure OS like Wubuntu without installing it on your machine? Or maybe install Windows to play old games while keeping Ubuntu? Or perhaps you just need a safe environment to test software without affecting your main system? VirtualBox lets you do all that. Here’s how to install it on Ubuntu 22.04 or 24.04 LTS.

Why Choose VirtualBox Over KVM or VMware?
Before we begin, let’s quickly go over why VirtualBox is a solid choice for virtualization:
✅ Free – Unlike VMware Workstation (which is a paid product), VirtualBox is completely free and open-source.
✅ Easy to Use – It has a user-friendly interface and doesn’t require extensive technical knowledge.
✅ Cross-Platform Compatibility – Works on Windows, macOS, and Linux.
✅ Powerful Features – Supports USB 3.0, shared folders, snapshots, seamless mode, and more.
Step 1: Import VirtualBox’s Repo GPG Key
First, we need to import the GPG key from the VirtualBox repository to verify the authenticity of the software we are about to install.
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg
Step 2: Add the VirtualBox Repository
Next, we add the official VirtualBox repository to Ubuntu 24.04. This ensures that updates are provided alongside the regular system updates.
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
Step 3: Update System Packages
Before installing VirtualBox, we need to refresh the package list:
sudo apt update
Step 4: Install VirtualBox 7.1
Now, we are ready to install VirtualBox on Ubuntu 24.04. Run the following command:
sudo apt install virtualbox-7.1 -y
🔹 Note: VirtualBox usually adds the vboxusers
group automatically. However, in some cases, this might not happen correctly. If needed, you can manually add your user to the group with:
sudo usermod -aG vboxusers $USER
After that, log out and log back in for the changes to take effect.
Step 5: Launch VirtualBox
You can find and open VirtualBox from the application menu. To make it easily accessible, right-click its icon and select “Pin to Dock”.

Step 6: Install VirtualBox Extension Pack (Recommended)
This is an optional step, but highly recommended, as it enhances the VirtualBox experience with additional features such as:
✅ USB 2.0 and USB 3.0 support
✅ VirtualBox Remote Desktop Protocol (VRDP)
✅ Webcam passthrough
✅ AES disk image encryption
✅ Intel PXE boot ROM
✅ NVMe SSD support
✅ Seamless display scaling
How to Install the Extension Pack
1️⃣ Check your VirtualBox version: Open VirtualBox and go to Help → About VirtualBox.
2️⃣ Visit the VirtualBox Downloads page.
3️⃣ Download the Oracle_VM_VirtualBox_Extension_Pack-xx.vbox-extpack file (matching your VirtualBox version).
4️⃣ Open VirtualBox, drag and drop the Extension Pack file into the VirtualBox window.
5️⃣ Click Install and accept the terms.
Common Errors and Fixes
🔥 Error: Kernel Driver Not Installed (rc=-1908)
🔹 Cause: VirtualBox requires kernel modules that are missing.
🔹 Solution: Run the following commands:
sudo apt install --reinstall virtualbox-dkms
sudo modprobe vboxdrv
⚠ If the issue persists, check Secure Boot settings and disable it if necessary.
🔥 Error: “VT-x is not available (VERR_VMX_NO_VMX)”
🔹 Cause: CPU virtualization (VT-x for Intel or AMD-V for AMD) is not enabled.
🔹 Solution: Check your BIOS settings and enable VT-x/AMD-V.
🔥 Error: USB Devices Not Recognized in VirtualBox
🔹 Cause: The Extension Pack is missing, or the user lacks USB permissions.
🔹 Solution: Add your user to the vboxusers
group:
sudo usermod -aG vboxusers $USER
Then, restart your computer.
🔹 Additional Tip: If VirtualBox fails to boot a VM, try checking your BIOS settings and disable Secure Boot or Flash Boot, then try again.
Frequently Asked Questions (FAQ)
❓ 1. Can I run Windows in VirtualBox?
✅ Yes! VirtualBox supports Windows, Linux, macOS, and many other operating systems.
❓ 2. Is VirtualBox slow?
✅ If VirtualBox is running slowly, enable u003cstrongu003eVT-x/AMD-Vu003c/strongu003e in BIOS and allocate more RAM and CPU to the virtual machine.
❓ 3. Can VirtualBox run on Ubuntu Server?
✅ Yes, but you may need to install u003cstrongu003eVirtualBox Guest Additionsu003c/strongu003e for better VM management.
Now that you have VirtualBox installed on Ubuntu 24.04, you can explore different operating systems, test applications in a safe environment, and expand your technical skills!
Need more VirtualBox tips and tricks? Check out my collection of in-depth guides.
Did you run into any issues installing VirtualBox on Ubuntu 24.04? Drop a comment below, and I’ll help you out!