If you want to try out a Linux distribution, you may want to do it in a virtual machine (VM) before dual-booting or completely overwriting your system. Choose a distribution and let’s run it in a VM using VirtualBox.
What Is VirtualBox?
VirtualBox is a program that allows you to install and run various operating systems (OS) inside 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 as a computer within a computer.
Before we begin, note that your computer needs to have enough system resources to handle both the VM and your regular operating system to smoothly create and run a virtual machine. Otherwise, you’re likely to have a slow and problematic experience. Here’s what we recommend as the minimum specs for smoothly running a VM:
- 8GB RAM
- 10GB of available storage for each VM
- A processor with at least four cores
Installing VirtualBox on Windows, Linux, and Mac
Installing VirtualBox itself on Windows, Linux, and macOS is pretty easy, though installing an OS in VirtualBox will require a bit of time, but fret not! We’re going to go over each step. While we install and set up VirtualBox.
To install VirtualBox on Windows, head over to the official VirtualBox downloads page and click on “Windows Hosts” to download the installer for Windows.
Double-click on the installer file to launch it and follow the steps to install VirtualBox on Windows. You know, the typical Windows way.
Ubuntu and Debian use DEB files, whereas Fedora, OpenSUSE, RedHat Enterprise Linux, and CentOS use RPM files. Download the relevant package and double-click on it to install VirtualBox. If you’re stuck, learn how to install a DEB file and an RPM file in Linux.
Installing Linux in VirtualBox
The steps for installing Linux in VirtualBox are pretty much the same on Windows, Linux, and macOS. If you haven’t already, choose a distro and start downloading the ISO so that it’s ready by the time we reach the step where we load it into the VM.
Launch VirtualBox from the app menu.
Click on “New.”
Enter a name for your Virtual Machine, choose a location you want to save it in, change the type to “Linux”, and set the version to the distro you’re using. If your distro isn’t listed, choose the closest distro, or the one it’s based on. For example, choose Ubuntu for an Ubuntu-based distro like Pop!_OS or Linux Mint.
When you’re ready, click “Next.”
Allocate the RAM using the slider or enter the value in the text box. If you’re installing Ubuntu or Ubuntu-based distros, we’d recommend selecting at least 4GB of RAM. Then, click “Next.”
Check the “Create a Virtual Hard Disk” radio button and click on “Create.”
Check the “VDI (VirtualBox Disk Image)” option and click on “Next.”
Lastly, check the “Dynamically Allocated” option if you want to keep your storage consumption as low as possible, then click “Create.”
Use the slider or the text box to allocate the storage for the VM. If your goal is only to try out the distro, 15GB will suffice.
Once done, you will see a Ubuntu VM on VirtualBox’s homepage. Click on the VM and click “Start.”
The VM window will pop up alongside a “Select start-up disk” popup. Click on the small “File” icon to select the ISO.
Click on the “Add” icon and select the distro’s 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 on “Choose” and start the VM.
The VM will then boot into your chosen Linux distro. You may be greeted by an installation screen, where you usually have the option to either try it out or install it in the VM. Once you’ve installed it, you won’t have to boot the ISO anymore and can simply launch the VM from VirtualBox’s console.
Installing VirtualBox Extension Pack
Want extra features and control over your VM? 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 downloads page.
Open VirtualBox and click on “Tools,” then click on “Preferences.”
Go to the “Extensions” tab.
Click on the tiny “+” icon located at the right-most corner of the window.
Select VirtualBox Extension Pack from the download location and click on “open.”
Finally, click on “Install.”
Now that your Linux virtual machine is up and running, here are some of the VirtualBox tips and tricks you need to know.