Search⌘ K
AI Features

Creating a New Virtual Machine

Discover how to create and configure an Ubuntu virtual machine with VirtualBox. Learn to download required software, allocate resources, and set up virtual drives to run Linux environments within your current system.

Downloading and installing VirtualBox

To create Ubuntu virtual machines, we need two pieces of software. First, we need the Ubuntu operating system itself. Visit Ubuntu’s downloads page, and select the desktop version of Ubuntu 18.04 LTS. The file is quite large and may take a while to download. Save this file to the Downloads folder.

Next, we need VirtualBox, the software we’ll use to create and manage our virtual machine. Visit VirtualBox’s download page, and download the version for your operating system. Once the software downloads, run the installer and accept all of the default options. The installer may ask for permission to install additional drivers or components, which we should allow.

Setting up a virtual machine

Once the installation completes, run VirtualBox. We see a menu across the top of the screen that looks like this:

Select the “New” button to create our machine. VirtualBox displays a wizard that walks us through creating our machine.

Naming the virtual machine

The first screen asks for a name for our machine and the operating system we plan to install.

Enter the following into the form:

  • For the “Name,” enter “Ubuntu1804” or something more descriptive.
  • For “Type,” choose “Linux.”
  • For “Version,” choose “Ubuntu (64-bit).”

When we’re ready, we click “Continue.”

Allocating memory

The next screen asks us to choose the amount of memory we want to allocate to the virtual machine. For a smooth experience, choose at least 1,024 MB of RAM. If you have 8 GB of RAM on your machine, consider choosing 2,048 MB of RAM instead. Once we’ve set the RAM, we click “Continue.”

Next, we create a hard disk for our virtual machine. This hard disk is nothing more than a big data file on our computer’s hard drive, but the operating system we install in VirtualBox will think it’s a real physical hard drive. It’ll see this hard drive instead of the real one on our computer. Select the default setting of “Create a virtual hard disk now” and click “Create.”

The wizard then asks for the hard disk file type. Choose the default of VDI (VirtualBox Disk Image) and press “Continue.” The next screen asks how VirtualBox should create the disk. VirtualBox can create a fixed disk, which allocates all of the space right away or dynamically allocates space as needed. A fixed disk results in slightly better performance when our machine is running because it doesn’t have to do any calculations to expand the size of the disk.

A dynamic disk saves disk space. Performance isn’t a concern here, so we can save disk space and let VirtualBox dynamically allocate space as needed. Select the option and click “Continue.”

Specifying properties of the disk

Next, VirtualBox asks for the file name and location of the disk and how big we want the disk to be, as shown in the figure below:

VirtualBox automatically uses the name of our virtual machine as the disk’s name. It places the disk’s file in the default folder that VirtualBox uses for virtual machines. While we can change this, it’s best to leave it as it is.

Set the size of the disk to 32 GB or more. The default 8 GB of space isn’t enough since we’ll install some additional programs. Then, click “Create.”

VirtualBox creates the new machine, which appears in the list of machines in VirtualBox’s interface. When we select the machine, we see a summary of the machine’s attributes, as shown in the figure below: