If you want to try out a Linux distribution, you can do so in a virtual machine (VM) before dual booting or completely overwriting your system. Choose a distro and run it on a VM using VirtualBox.

What is VirtualBox?

VirtualBox is a program that allows you to install and run various operating systems (OS) within your existing operating system using the concept of virtual machines. As the name suggests, a VM is a virtual computer that can run programs and operating systems. Think of it like a computer within a computer.

Before you begin, please note that your computer must have enough system resources to handle both the virtual machine and your normal operating system to create and run a virtual machine smoothly. Otherwise, you are likely to have a slow and troublesome experience. Here’s what we recommend as the minimum specs to successfully run a virtual machine:

  • 8GB RAM
  • 10 GB of available storage for each VM
  • A processor with at least four cores

Installing VirtualBox on Windows, Linux, and Mac

Installing VirtualBox on Windows, Linux, and macOS is pretty easy, though installing an operating system on VirtualBox will take a bit of time, but don’t worry! Let’s go over each step. While we install and configure VirtualBox.

To install VirtualBox on Windows, go to the official VirtualBox download page and click “Windows Hosts” to download the installer for Windows.

Download VirtualBox for Windows

Double-click the setup file to launch it and follow the steps to install VirtualBox on Windows. You know, the typical Windows way.

Open the VirtualBox installer to install

To install VirtualBox on a Mac, you need to go to the download page and click on “OS X hosts”. After downloading the DMG file, open it and drag its contents to your Applications folder.

Installing VirtualBox on various Linux distributions (distributions) is also quite easy. You need to go to the Linux download page and download the installation package for your distribution.

Download VirtualBox on Linux distributions

Ubuntu and Debian use DEB files, while Fedora, OpenSUSE, RedHat Enterprise Linux, and CentOS use RPM files. Download the corresponding package and double-click it to install VirtualBox. If you’re stuck, learn how to install a DEB file and an RPM file on Linux.

RELATED: Debian vs. Ubuntu Linux: Which Distribution Should You Choose?

Installing Linux in VirtualBox

The steps to install Linux in VirtualBox are pretty much the same on Windows, Linux, and macOS. If you haven’t already, choose a distribution and start downloading the ISO so it’s ready when we get to the step where we load it into the virtual machine.

RELATED: The best Linux distributions for beginners

Start VirtualBox from the application menu.

Open VirtualBox from the application menu

Click “New”.

Create a new VirtualBox virtual machine

Enter a name for your virtual machine, choose a location where you want to save it, change the type to “Linux”, and set the version to the distribution you’re using. If your distribution is not listed, choose the distribution that is closest to or based on it. For example, choose Ubuntu for an Ubuntu-based distribution like Pop!_OS or Linux Mint.

When you’re ready, click “Next.”

Give your virtual machine a name and select Linux vrsion

Allocate RAM using the slider or enter the value in the text box. If you are installing Ubuntu or Ubuntu-based distributions, we recommend that you select at least 4 GB of RAM. Then click “Next.”

Allocate RAM to your virtual machine

Check the radio button “Create a virtual hard drive” and click “Create”.

Create a virtual hard drive for OS

Check the “VDI (VirtualBox Disk Image)” option and click “Next”.

Check the VirtualBox disk image and click next

Lastly, check the “Dynamic Allocation” option if you want to keep your storage consumption as low as possible, then click “Create”.

Check Assign dynamically and click next

RELATED: How to convert between fixed and dynamic disks in VirtualBox

Use the slider or text box to allocate storage for the virtual machine. If your goal is just to test the distro, 15 GB will suffice.

allocate hard drive space and click Create

Once done, you will see an Ubuntu VM on the VirtualBox home page. Click on the virtual machine and click “Start”.

Start virtual machine

The virtual machine window will appear along with the “Select Startup Disk” popup. Click the little “File” icon to select the ISO.

Select an ISO on the virtual machine

Click the “Add” icon and select the distribution ISO file from the download location. If you already have a bootable Linux USB, you can also boot from a USB drive in VirtualBox.

Finally, click “Choose” and start the VM.

Add ISO to run virtual machine

The virtual machine will then boot into your chosen Linux distribution. You may be greeted by an installation screen, where you usually have the option to try it or install it to the virtual machine. Once you’ve installed it, you no longer need to boot the ISO and can simply boot the virtual machine from the VirtualBox console.

VM boot into Ubuntu installer

Installing the VirtualBox extension pack

Want additional features and control over your virtual machine? Installing the VirtualBox extension pack adds support for USB, webcam, and more. Here’s how to download and install it in VirtualBox.

Download the VirtualBox extension pack from the download page.

Download the VirtualBox extension pack

Open VirtualBox and click “Tools”, then click “Preferences”.

Click Preferences

Go to the “Extensions” tab.

Go to the extensions tab

Click on the small “+” icon located in the far right corner of the window.

Add new extension

Select VirtualBox Extension Pack from the download location and click “open”.

Open the VirtualBox extension pack

Finally, click “Install”.

Install the VirtualBox extension pack

Now that your Linux virtual machine is up and running, here are some of the VirtualBox tips and tricks you need to know.

RELATED: 10 Advanced VirtualBox Tricks and Features You Should Know