How to create a Linux virtual machine with VirtualBox

Linux is everywhere — in phones, smart devices, cloud storage services, cars, thermostats, and pretty much anything with an embedded system or major third-party service.

It can also be on your desktop. Linux is a fantastic choice as a desktop operating system because it’s incredibly reliable, secure, and more flexible than any other operating system on the market. But for those who might hesitate to install Linux over macOS or Windows, what can you do? One route that makes testing and using Linux very easy without changing anything to your primary operating system is the virtual machine route.

A virtual machine allows you to run a guest operating system on your host without making any changes (other than installing the virtual machine platform) to your primary operating system. My favorite virtual machine platform is called VirtualBox, which can be installed on Linux, macOS, and Windows hosts. VirtualBox is free and very easy to use.

I’ll walk you through the process of creating a Linux virtual machine with VirtualBox so you can try out the open-source operating system. I won’t walk you through the process of installing VirtualBox as it is as simple as installing any application on your computer.

With that said, let’s get our virtual machine up and running.

Creating the virtual machine

1. Open VirtualBox

First, open VirtualBox from your computer’s desktop menu. Once the application is open, click on Tools and then on New (illustration 1).

The main window of VirtualBox.

The VirtualBox main window shows that I have already created some virtual machines.

Image: Jack Wallen

2. Name your new guest operating system

I’m going to boot up a virtual machine for FerenOS, a Linux distribution. In the first window of the wizard (figure 2), give the virtual machine a name, select the folder for the files, select the operating system type and version for the new virtual machine, and then click Next.

The VirtualBox VM naming window.

Naming our new virtual machine.

Image: Jack Wallen

3. Configure RAM

In the next window, move the memory size slider to the right to increase the amount of RAM you want to allocate to the computer (figure 3).

VirtualBox virtual machine memory size.

Configuring memory for our new virtual machine.

Image: Jack Wallen

4. Create a virtual disk

Click Next and in the resulting window (figure 4), click Create to create a new virtual disk.

The VirtualBox disk creation window.

Creating a new virtual disk for our guest OS.

Image: Jack Wallen

In the next two windows, select VDI and then select Dynamically Assigned. In the last window, slide the slider to the right to increase the virtual disk size to the desired size and make sure to select the folder where you want the drive to be (Figure 5).

VirtualBox's virtual hard disk resizing tool.

Dimensioning of the virtual disk according to your requirements.

Image: Jack Wallen

Click Create and you will be returned to the main VirtualBox window.

Configure your guest operating system

We can now configure our guest operating system. One thing you should definitely do (before doing this step) is download the ISO file for the version of Linux you want to install.

1. Add the ISO image for installation

Select the virtual machine you just created in the left pane, then click Settings. In the resulting window, click on Storage and then click on the left + labeled Controller: IDE (Figure 6).

The VirtualBox settings window.

This is where you configure all aspects of your virtual machine.

Image: Jack Wallen

In the resulting window (Figure 7), click Add, and when your file manager opens, navigate to the location where you saved the ISO image for the Linux distribution you downloaded.

The VirtualBox image picker.

Adding an ISO image for installation.

Image: Jack Wallen

After choosing your ISO image, click Choose and then click OK. You should now find yourself back in the main VirtualBox window where you are ready to run the virtual machine.

Start the installation

Select the virtual machine you just created in the left navigation and click the Start button, which will launch the bootable image and you should – depending on your chosen Linux distribution – end up on either the live image ( where you can either test or install the guest OS) or immediately install the guest OS (Figure 8).

FerenOS can be installed as a virtual machine.

You can now install Linux as your guest operating system.

Image: Jack Wallen

Make sure you go through the full installation process for your chosen guest operating system. In most cases, this involves clicking the Install icon on the desktop.

Congratulations, you have just created your first virtual machine with Linux as the guest operating system. Enjoy pedaling the hoops of your new open source platform.

About Willie Ash

Check Also

What are the current software trends? TypeScript, Rust, C#—and ethics, say these pros

It is Software Trends Month here, at Technicallywhich means we examine what’s changed, what’s stayed …