This article is part of a series on how to install Linux on Windows and Mac using the Oracle virtual machine from VirtualBox. As there are several factors to consider, which range from the choice of the Linux distribution to the configuration of the virtual machine itself, I divided this procedure into three articles:
This article provides an overview of the elements to consider before you install Linux on your Windows or Mac computer.
This article elaborates on different characteristics specific to Linux, which will help you decide the ideal distro to choose as your additional operating system.
Part Two: Configuring a Linux Virtual Machine
The present article. In it, you will find a step-by-step guide on how to configure the parameters of the virtual machine that will host your new Linux OS.
Configuring your Virtual Machine for Linux
Before configuring your virtual machine, it is crucial to know both the characteristics of your system’s hardware and the Linux distribution you want to use. Without having these bases covered, it will be difficult to configure your virtual machine properly.
As mentioned in the overview article (link), we will use Oracle VM VirtualBox, a free cross-platform virtual machine software available on both Windows 10 and macOS Mojave.
To create an Oracle virtual machine, you first need to have the Oracle VM VirtualBox software installed.
Head to the software’s download page: https://www.virtualbox.org/wiki/Downloads.
From there, click on “Windows hosts” if you run Windows 10, or on “OS X hosts” if you run macOS Mojave to download the file appropriate to your OS (.exe for Windows, .dmg for macOS).
Follow the installation instructions provided in the installation wizard.
Once you have installed VirtualBox and downloaded the disc image of your Linux distribution, you are ready to create your first Oracle virtual machine.
Creating a New Virtual Machine
Upon opening the software, you will see “Oracle VM VirtualBox Manager.” Click on the “New” icon.
From there, you will have to:
Give a name to your virtual machine
Any name will do, even though using the name of your distribution is highly recommended.
I suggest using the distro’s name as-is. VirtualBox has a neat feature that recognizes the underlying version of your Linux OS automatically.
Some distros are derivatives; that means that they are a “spin-off” of another Linux OS. By entering its exact name as your VM name, you won’t have to choose its version manually. To do so can quickly become problematic if you use a derivative without being aware of it.
For instance, as shown in the example below, “Linux Mint” is a derivative of “Ubuntu (64-bit)”, which is something those new to Linux might not necessarily know.
Choose the folder where you will keep the machine’s content.
By default, your VirtualBox creates a particular folder for all its Oracle Virtual Machines. Unless you want your files to be somewhere specific, keep the Machine Folder as-is.
Select a Type
Here, the choice is pretty straightforward: choose Linux. By default, VirtualBox selects the appropriate one for you (as long as you entered the name of your OS under the “Name” section).
Choose a distribution
That option is usually done automatically by VirtualBox.
What if you see that the software hasn’t attributed a version to your Linux distribution (as can be the case with some lesser-known ones)? In that case, select “Other Linux (64-bit)” or “Other Linux (32-bit)”, depending on your system’s architecture.
Once you click “Continue,” you will be asked to attribute a memory size to your machine. The default will vary according to the OS “Type” and “Version” you chose earlier.
In the example below, the default is 1024MB. As Linux Mint is considered a somewhat lightweight distribution, its RAM allocation was set pretty low by VirtualBox.
Be aware that the default memory size can sometimes be inadequate. That is from personal experience; results might vary according to your distribution. An important factor that can result in a possibly incorrect memory allocation is your desktop environment.
Indeed, your Oracle virtual machine might not consider the relative “weight” of your DE. A lightweight desktop environment will require fewer resources and can probably fare exceptionally well with the default memory allocation. However, if you know that you are using a DE like KDE Plasma 5, Cinnamon or GNOME 3, you might want to up the memory size.
In all cases, consider the following before choosing a memory size:
- If you plan on ever firing up two or more virtual machines at the same time, use the smallest functional memory size possible. Refer to the minimal hardware requirements of each OS, and try to stick to lightweight Linux distributions and desktop environments only.
- Make sure that you still allow enough memory for your OS to work appropriately. A too low memory allocation will result in subpar performance, possible rendering lags, and crashes.
- Do NOT go beyond the green part of the scale. Even hovering towards the end of the scale is pushing it, especially if you plan on actively using your main OS while booting the VM. Remember that the number at the far right represents the total RAM available on your computer. You have to leave some space for your primary operating system!
Once you have chosen the memory size, click on “Continue.” VirtualBox will provide you with a recommended hard disk size (in this example, 10.00 GB).
You will have to choose between “Do not add a virtual hard disk,” “Create a virtual disk now” or “Use an existing virtual disk file.”
- “Do not add a virtual hard disk”: Do not use this option as it defeats the goal of this guide.
- “Create a virtual disk now”: The usual go-to option.
- “Use an existing virtual disk file”: This option usually doesn’t apply. That is unless you had previously created an empty standalone virtual hard disk and now wish to attribute it to your machine.
By default, “Create a virtual hard disk now” is selected. Click on “Create.”
Choosing a Hard Disk Type
You will be asked to choose a hard disk file type. Unless you plan on using your Oracle virtual machine on another virtualization software (such as VMware), keep the default option “VDI (VirtualBox Disk Image).” Click “Continue”.
You will now have to choose between a dynamically allocated hard disk file or a fixed size one.
Dynamically allocated hard disk:
If your computer has limited storage space, it is recommended to select “Dynamically allocated.” With this option, your virtual machine “will only use space on your physical hard disk as it fills up, up to a maximum fixed size” of your choice. That means that a virtual machine with an allocated maximum hard disk space of 25 GB will not automatically take 25 GB from your internal hard drive. Instead, it will start by using the minimum space required for your operating system files, then gradually take up more space as more files and applications are used (up to a maximum of 25 GB).
Fixed-size hard disk:
Those with two or more internal hard disks or those who possess a machine with a lot of internal hard drive space available might want to opt for “Fixed size” instead. By using a fixed virtual hard disk allocated storage, your virtual machine will run faster, at the cost of having the whole disk space being taken from your available internal hard drive storage right away.
As my laptop has limited space available (128 GB total), I opted for “Dynamically allocated.”
Choose your file location and size
By default, VirtualBox will create a name for your new virtual machine file. You can also choose to save the VM to a different folder.
You will then have to select the size of the virtual hard disk. By default, VirtualBox will choose the recommended size it provided earlier. Just as with the memory allocation, you have to keep some factors in mind when selecting the disk storage size:
- What is the minimal storage space requirement of your OS? Will it be enough, or should you instead opt for more? Some distributions can work pretty well using only the minimum requirements, but others will require more than the bare prerequisites for your experience to be enjoyable. However, more often than not, the minimal requirements are for a bare-bone installation. As such, the addition of software applications (usually even basic ones) will up your storage needs quickly.
- The storage space proposed by VirtualBox might not be enough for your Linux distribution. That has happened to me twice so far. Both Linux Mint and Debian required more storage space for a full installation than what I had initially configured using the default storage size.
- What do you intend to do on your virtual machine? Browse the web and watch videos online? Then you might not need significant storage space. However, if you plan on downloading large files or installing many games, then up the hard disk size.
- Beware of your maximum storage space. If you plan on creating many virtual machines, size can add up quickly even when using dynamically allocated space. Also, take into consideration the available space on your internal hard drive, and whether or not you plan on downloading many large files or installing new applications on your primary operating system after having configured your VM.
Adding your Linux OS to the VM
Once you have chosen a file size for your virtual machine (you can do so either by sliding the arrow or entering a number manually), click on “Create.”
Your new virtual machine will automatically appear on the left side of the Oracle VM VirtualBox Manager. The only step left is to add your OS disc image to the virtual machine.
To do so, open it by clicking on the “Start” icon.
You will be asked to select a virtual optical disk file (default is set as “Empty”). Click on the folder icon, and add the downloaded ISO file of the operating system you plan on using.
In this example, as I configured a VM for Linux Mint, I will choose the disc image of that distribution.
Once the ISO file selected, click “Start.” Voilà! You are now ready to install your operating system.
To close the virtual machine, either power it off from within the operating system, or click on the VirtualBox “x” icon. The virtual machine will ask whether you want to “save the machine state,” “send the shutdown signal” or “power off the machine.” By choosing “save the machine state,” upon starting your VM again, you will resume your OS session as it was previously left off.