How to Install VirtualBox in Linux
Last Updated :
12 Jul, 2025
Virtual Machine abstracts the hardware of our personal computers, such as CPU, disk drives, memory, NIC (Network Interface Card), etc., into many different execution environments as per our requirements, hence giving us a feeling that each execution environment is a single computer.
How to Install VirtualBox in LinuxFor example, VirtualBox. We can create a virtual machine for several reasons, all of which are fundamentally related to the ability to share the same basic hardware yet also support different execution environments, i.e., different operating systems simultaneously.
Methods to Install VirtualBox on our Debian-based Linux system
Here are three ways to download VirtualBox on a Debian-based system like Ubuntu. Each method offers different advantages, such as convenience or the ability to get the latest version of the software.
Method 1: Install VirtualBox from Ubuntu Repository
Open the terminal and run this command.
sudo apt install VirtualBox
sudo apt install VirtualBoxVerify Installation
We use the `dpkg` command, which is used to manage installed packages on Debian-based systems like Ubuntu.
dpkg -l | grep virtualbox
dpkg -l | grep virtualboxMethod 2: Install VirtualBox using GUI (Graphical User Interface)
Downloading and Installing VirtualBox. To download VirtualBox, go to the official site virtualbox.org and download the latest version for Linux.
For example: We want to install VirtualBox for Ubuntu.
Step 1: Double Click on this
select Ubuntu 22.04Step 2: Follow the numbering.
First Right click and select 'open with other application', then follow the numbering.
Steps for installing VirtualboxStep 3: Click on Install
Click on InstallStep 4: Search Virtualbox and Double click on application.
Virtualbox applicationVirtualBox application Opened.
VirtualBox in UbuntuMethod 3: Installing VirtualBox using Oracle's repository
Step 1: Run this command in your terminal (adding key for the repository)
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo gpg --dearmor -o /usr/share/keyrings/oracle-virtualbox-2016.gpg
Step 2: Run this command in your terminal (adding Oracal VirtualBox repository in the repository list)
sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
Step 3: Update the package list.
sudo apt-get update
Step 4: Command for installation of virtualbox
sudo apt-get install virtualbox
Installing the Extension Pack
To unlock advanced features like USB 2.0/3.0 support, RDP (Remote Desktop Protocol), and PXE boot, you need to install the Extension Pack.
Steps:
Download the Extension Pack: Run the following command in the terminal:
wget https://download.virtualbox.org/virtualbox/7.0.18/Oracle_VM_VirtualBox_Extension_Pack-7.0.18.vbox-extpack
Install the Extension Pack: Now, install it using this command:
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.18.vbox-extpack
This will enable support for extra features in VirtualBox, making it more powerful and flexible.
Troubleshooting Common Issues
1. Kernel Module Not Loading
If VirtualBox isn't starting properly, it could be because the kernel module isn’t loaded. To fix this, run the following command in the terminal:
sudo /sbin/vboxconfig
This command rebuilds the VirtualBox kernel module.
2. "Virtualization Not Enabled" Error
If you see an error about virtualization not being enabled, it means your system’s BIOS/UEFI needs to have virtualization features turned on. To fix this:
- Restart your computer and enter the BIOS/UEFI settings.
- Look for a setting called Intel VT-x (or AMD-V for AMD processors).
- Enable it, save your settings, and restart.
3. Dependency Errors
Sometimes VirtualBox might fail to install due to missing dependencies. If you see errors like that, simply run:
sudo apt --fix-broken install
This will fix broken dependencies and complete the installation.
Must Read
Conclusion
VirtualBox lets you run multiple operating systems on a single machine, ideal for testing, development, and learning. You can install it from the Ubuntu repository, GUI, or Oracle’s repository, each offering different advantages. Don't forget to install the Extension Pack for advanced features like USB and RDP support. If you run into issues, solutions for kernel modules, virtualization settings, and dependencies are easy to follow. VirtualBox provides the flexibility to create and configure virtual machines as needed for various tasks.