VirtualBox is one of the most popular and reliable virtualization software solutions available today. It allows you to run multiple operating systems (OS) on your computer without the need for additional hardware, making it an invaluable tool for developers, testers, and tech enthusiasts alike. If you want to install VirtualBox on Ubuntu , you’re in the right place.
In this detailed guide, we’ll walk you through how to install VirtualBox on Ubuntu, providing step-by-step instructions tailored for beginners. Whether you’re looking to run Windows on Ubuntu or experiment with other Linux distributions, VirtualBox is a great option. So, let’s dive into the process of getting VirtualBox set up on your Ubuntu system.
What is VirtualBox and Why Use It?
Before we begin, let’s take a quick look at what VirtualBox is and why you might want to use it on Ubuntu.
What is VirtualBox?
VirtualBox is an open-source virtualization software developed by Oracle. It allows users to create and manage virtual machines (VMs), which are software-based emulations of physical computers. With VirtualBox, you can run different operating systems inside your main OS (host system) in isolated environments.
Why Use VirtualBox on Ubuntu?
- Multiple OS Environments: VirtualBox enables you to run various operating systems like Windows, macOS, or different Linux distributions alongside your Ubuntu setup.
- Testing and Development: It’s ideal for developers who need to test software or configurations on multiple systems without switching between devices.
- Security: Virtual machines provide an extra layer of security by keeping potentially risky activities isolated from your main system.
Now that we understand VirtualBox’s purpose, let’s get started on how to install VirtualBox on Ubuntu.

Step-by-Step Guide How to Install VirtualBox on Ubuntu?
Installing VirtualBox on Ubuntu can be done through multiple methods: using the terminal or through the graphical interface. For this guide, we’ll focus on the terminal installation process, which is straightforward and efficient.
Step 1: Update Your System
Before you install any new software, it’s always a good idea to update your system. This ensures that all your system packages are up-to-date and minimizes the chance of compatibility issues.
- Open the terminal in Ubuntu by pressing
Ctrl + Alt + T
. - Run the following commands to update your package list and upgrade your system:
sudo apt update sudo apt upgrade
- If any updates are available, follow the prompts to install them.
Step 2: Install Required Dependencies
VirtualBox requires certain dependencies to run properly. These packages ensure that VirtualBox can function as intended without encountering errors.
- In the terminal, run the following command to install the required packages:
sudo apt install -y dkms build-essential linux-headers-$(uname -r)
dkms
: Ensures that kernel modules for VirtualBox stay up to date.build-essential
: Provides the necessary tools to build and compile software.linux-headers-$(uname -r)
: Installs the appropriate Linux headers for your current kernel.
Step 3: Add the VirtualBox Repository
Ubuntu offers VirtualBox in its official repository, but to get the latest version, you’ll need to add the Oracle repository.
- To add the repository, first download the Oracle public key by running the following command:
wget -q https://www.virtualbox.org/download/oracle_vbox.asc sudo apt-key add oracle_vbox.asc
- Add the VirtualBox repository:
sudo sh -c 'echo "deb https://download.virtualbox.org/virtualbox/debian $(lsb_release -c | awk "{print $2}") contrib" > /etc/apt/sources.list.d/virtualbox.list'
This command ensures that Ubuntu can download and install the latest version of VirtualBox from the Oracle repository.
Step 4: Install VirtualBox
Now that the repository is set up, it’s time to install VirtualBox.
- Update the package list again to include the newly added repository:
sudo apt update
- Install VirtualBox by running:
sudo apt install virtualbox-6.1
Replace6.1
with the latest version number available if needed. If you’re unsure, you can check the version of VirtualBox available by runningsudo apt search virtualbox
.
Step 5: Verify Installation
Once the installation is complete, you can verify that VirtualBox has been installed successfully.
- Type the following command in the terminal:
virtualbox
- If VirtualBox starts up, then the installation was successful.
Post-Installation: Installing VirtualBox Extension Pack
While VirtualBox is functional right after installation, you can enhance its capabilities by installing the VirtualBox Extension Pack. This adds support for USB devices, remote desktop, and other advanced features.
Step 1: Download the Extension Pack
- Visit the VirtualBox download page.
- Under the “VirtualBox Extension Pack” section, download the version that corresponds to the version of VirtualBox you installed.
Step 2: Install the Extension Pack
- Once downloaded, open the terminal and run the following command to install the extension pack:
sudo VBoxManage extpack install --replace /path/to/extension_pack.vbox-extpack
- Follow the prompts to complete the installation. The extension pack will enable additional features like USB 2.0 and 3.0 support.
How to Create a Virtual Machine in VirtualBox?
After installing VirtualBox, the next step is creating a virtual machine to run a different operating system. Here’s a brief overview of the process.
Step 1: Open VirtualBox
- Open VirtualBox by typing
virtualbox
in the terminal or searching for it in your applications menu.
Step 2: Create a New VM
- Click the “New” button in the top-left corner of the VirtualBox window.
- Choose a name for your virtual machine and select the type and version of the operating system you wish to install (e.g., Ubuntu, Windows, etc.).
- Follow the prompts to allocate memory (RAM) and create a virtual hard disk for the VM.
- Once the VM is created, you can start it by selecting it and clicking “Start.”
Step 3: Install the OS
- Insert the installation media (ISO file or physical disk) for the OS you want to install into the VM.
- Follow the OS installation instructions to complete the setup.
FAQ
1. How to install VirtualBox on Ubuntu terminal?
Follow the steps outlined in this guide. The terminal method is simple: update your system, install dependencies, add the VirtualBox repository, and then install the software using the command sudo apt install virtualbox-6.1
.
2. How to install VirtualBox step by step?
The installation steps are as follows:
- Update your system with
sudo apt update
andsudo apt upgrade
. - Install required dependencies.
- Add the Oracle repository and its key.
- Install VirtualBox via
sudo apt install virtualbox-6.1
. - Optionally, install the VirtualBox Extension Pack.
3. Is VirtualBox good for Ubuntu?
Yes, VirtualBox is an excellent tool for Ubuntu users who need to run multiple operating systems or test software in isolated environments. It works well on Ubuntu, providing a straightforward way to manage virtual machines.
4. Can I install VirtualBox in Linux?
Yes, VirtualBox is compatible with various Linux distributions, including Ubuntu. The installation process may vary slightly depending on the distribution, but the steps for Ubuntu should work for most Linux systems.
Conclusion
Install VirtualBox on Ubuntu is a straightforward process that opens up a world of possibilities for running multiple operating systems on your computer. Whether you’re a developer, tester, or enthusiast, VirtualBox allows you to explore various environments without needing additional hardware.
By following the steps in this guide, you should be able to install VirtualBox on Ubuntu machine and start creating virtual machines in no time. Don’t forget to install the VirtualBox Extension Pack for additional functionality!
Feel free to comment below if you run into any issues or if you have questions about the process. Happy virtualizing!
If you found this guide helpful, consider sharing it with your friends or exploring other related content on our website for more install tips and tricks on using Ubuntu and VirtualBox.
Read Also : How to Install VirtualBox on Windows?