How to Install VirtualBox in Linux
Last Updated :
11 Jun, 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.
Similar Reads
How to Install VirtualBox in Linux? 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 V
4 min read
How to install CSI Linux in VirtualBox? What if there is a multi-purpose operating system designed especially for cyber investigators, yes you read it right and the answer to that question is, yes there is one such operating system known as CSI Linux. It is an open-source 'theme park' for the cyber security industry enthusiast. It has ton
3 min read
How to Install Arch Linux in VirtualBox? Installing Arch Linux on a virtual machine is an excellent way to experience this powerful and flexible Linux distribution without affecting your main system. If you're looking to install Arch Linux in VirtualBox, this guide will take you through the process step-by-step. Arch Linux is known for its
7 min read
How to Install Kali Linux in VirtualBox? Dual Booting a Windows Laptop with Kali Linux, Though increases the speed and efficiency of the OS, but we can not switch between Windows and Kali Linux instantly. To do so, we will have to install Kali Linux in Virtual Box or any other hypervisor. So, what is a hypervisor? Refer to this article Hyp
5 min read
How to install Virtualmin in Linux In this article, we will learn to install Virtualmin on Linux Operating System. Virtualmin is based on Webmin, a popular web server management user interface for Linux. It is a domain hosting and website control panel that enables the creation and management of multiple domains and simplifies automa
3 min read
How to Install Kali Linux VirtualBox Image? Kali Linux is considered as the best perpetration testing Linux distribution as it comes with every important tool pre-installed in it. If you have a spare system you can directly install Kali into it, but if you plan to use it in a virtual environment then the best and safest method would be to use
2 min read