Part 2: How to Set Up a Virtual Machine on VirtualBox

Nithil Krishnaraj
TechTalkers
Published in
6 min readJul 8, 2020

In Part 2, I will show you how to install and set up VirtualBox.

If you followed the steps in my Part 1 article for how to install and set up VirtualBox, then you have successfully installed virtualization software (VirtualBox) on your computer. Now, I will show you how to continue the VM setup process and set up an extension pack.

Step 1: Picking an Operating System

It’s time to pick an OS for your virtual machine. I will be using Linux Mint, but you can use any supported operating system.
A list of supported operating systems on VirtualBox can be found here.

Go ahead and download the ISO file of the operating system of your choice.

Step 2: Create a Virtual Machine

Now that we have an operating system, let’s create a virtual machine.

At the top, click on the “New” button.

In this pop-up window, name your Virtual Machine whatever you want. It will automatically configure the OS and OS version/type if you type in the name of the OS. As you can see, I have typed in Linux Mint, and it has automatically configured the OS, as it displays the OS and the OS type.

If it doesn’t automatically configure it, you can use the dropdowns.

The first dropdown menu allows you to pick the operating system.

The second dropdown menu allows you to choose the version/type of the operating system.

After you have configured your OS, press “Next” to proceed.

Here, you can pick the amount of RAM you want to dedicate to your virtual machine. I picked 2048MB (2GB) of RAM for my virtual machine, as Linux Mint doesn’t require a lot of resources. For resource-heavy operating systems like Windows 10 or macOS, you should dedicate at least 4GB for an optimal experience.

Once you’re done configuring the RAM, proceed with the setup and press “Next.”

Now, the system will allow you to create a virtual hard disk for your virtual machine.

Press “Next” to continue.

These are the types of formats for your virtual hard disk.

  • VDI — VDI stands for Virtual Disk Image. VDI is the native hard disk format for VirtualBox and therefore works better. I recommend this.
  • VHD — VHD stands for Virtual Hard Disk. VHD is the native hard disk format for Microsoft Virtual PC (a virtualization software by Microsoft) but also works on VirtualBox.
  • VMDK — VMDK stands for Virtual Machine Disk and was originally developed by VMWare, but it can also be used natively on VirtualBox.

Press “Next.”

There are two types of virtual hard disks: dynamically allocated and fixed size.

  • Dynamically Allocated — Dynamically allocated hard disks will gradually expand as space is used until it reaches the allocated limit. This is great if you don’t want to allocate a certain amount of storage right away. I recommend this option.
  • Fixed Size — This will create a fixed amount of storage right away. It takes much more time to create a fixed-sized hard disk but will improve virtual machine performance.

Press “Next.”

Here, you can allocate storage for your virtual machine. For Linux, I recommend a minimum of 16GB. For Windows and macOS, I recommend a minimum of 32GB.

Press “Next.”

Now that we have configured RAM and storage, it is time to configure the processor and graphics of the virtual machine.

On the top, click on “Settings.”

In the Settings window, navigate to the “Processor” tab.

By default, VirtualBox will allocate 1 core for a virtual machine. Most operating systems these days cannot run on 1 core, so it’s advised to allocate at least 2 cores. Proceed with setup once you’re done allocating cores.

Press “OK.”

Optional: Setting Graphics Memory

This is optional, but if you want smoother transitions for your virtual machine, you can increase graphics memory. I have integrated graphics so I can only max to 128MB. I prefer setting it to the maximum, but it isn’t necessary.

Step 3: Booting Into the Virtual Machine

On the top, press “Start” to boot into the virtual machine.

Here, you will pick your chosen operating system’s ISO file. Click on the folder to locate the ISO.

Press “Add.”

Locate the ISO and press “Open.”

Now, press “Choose.”

Press “Start.”

Awesome! We have booted into our virtual machine. Now, all you have to do is follow the installation steps of your chosen operating system.

Step 4: Setting Up the Extension Pack for the VM

For Windows VMs, refer to an article by extremetech.com.

For macOS VMs, refer to an article by addictivetips.com.

For Linux VMs, I will guide you through the extension pack setup process.

Click on “Devices,” and then select “Insert Guest Additions CD image..” in the drop-down menu.

Open the Terminal.

We are going to create a new directory, and to create one, type:

sudo mkdir -p /mnt/cdrom

You will be prompted to type in your password. When you’re done, hit “Enter” on your keyboard.

Now, we’re going to mount the extension pack to our virtual machine.

What does mount mean? — Mounting simply means adding another file system to the virtual machine, which will allow for better integration between the extension pack and the virtual machine.

To mount the extension pack, type in:

sudo mount /dev/cdrom /mnt/cdrom

Since you have already entered your password, it won’t ask for it again.

Navigate to the directory using:

cd /mnt/cdrom

Run the extension pack by typing:

sudo sh ./VBoxLinuxAdditions.run --nox11

Once that’s done, reboot your system for the changes to take effect.

Congratulations, you have set up your first virtual machine! If you followed the steps correctly, you should get it working properly.

--

--

Nithil Krishnaraj
TechTalkers

Co-founder and Writer of TechTalkers. Learning about technology and photography are my passions!