What is VirtualBox?

Oracle VM VirtualBox is a cross-platform virtualization application developed by the Oracle Corporation. It allows users to install operating systems on virtual hard disks such as Windows, macOS, Solaris and Linux.

As an example, you can run Windows and Linux on your Mac, run Windows server on your Linux server, or run Linux on your Windows PC while running your other existing applications.

Disk space and memory are the only problems that you'll face when installing multiple virtual machines.

Why You’ll Need It

  • Oracle’s VirtualBox is easy to install and use
  • It's free
  • You can run and experience any operating system safely
  • If you’re a developer, VirtualBox can be used as a tool for safely testing your own development projects in multiple OS environments
  • It can run everywhere from small embedded systems to laptops
  • It's good for testing and disaster recovery as it can be easily copied, backed-up, and transported between hosts

VirtualBox Installation

VirtualBox can be downloaded here: VirtualBox Downloads

Why Ubuntu?

  • It's free
  • Easy customization: The GNOME desktop environment helps you customize easily
  • It's secure
  • Ubuntu is open-source
  • Friendly and supportive community
  • Low system requirements
  • According to FOSSBYTES, Ubuntu is the second best Linux distro for programming and developers [2019 Edition]
  • It's beginner friendly

Setup for Ubuntu

First, open VirtualBox, then click "New" to create a virtual machine.

start-1

Enter "Ubuntu" as the name, select "Linux" as the type, and select Ubuntu (64-bit) as the version.

Screenshot--14-

NOTE: Select any amount of memory you wish, but don't add more than 50 percent of your total RAM.

Check the "Create a virtual hard disk now" option so we can later define our Ubuntu OS virtual hard disk size.

Screenshot--16-

Now, we want to select "VHD (Virtual Hard Disk)".

Screenshot--17--1

Next, we'll dynamically allocate storage on our physical hard disk.

Screenshot--18-

We want to specify our Ubuntu OS's size. The recommended size is 10 GB, but you can increase the size if you wish.

Screenshot--19-

After creating a virtual hard disk, you'll see Ubuntu in your dashboard.

Screenshot--20-

Now, we have to set up the Ubuntu disk image file (.iso).

The Ubuntu disk image file can be downloaded here: Ubuntu OS download

Screenshot--23-

To set up the Ubuntu disk image file, go to settings and follow these steps:

  1. Click "Storage"
  2. In storage devices, click "Empty"
  3. In attributes, click the disk image and "Choose Virtual Optical Disk File"
  4. Select the Ubuntu disk image file and open it
Screenshot--25-

Click OK.

Your Ubuntu OS is ready to install in VirtualBox. Let's start!

Screenshot--26-

NOTE: Ubuntu VirtualBox installation and actual OS installation steps may vary. This guide helps you to install Ubuntu in VirtualBox only.

Let's install Ubuntu!

Click Install Ubuntu.

Screenshot--27-

Select your keyboard layout.

Screenshot--29-

In the "Updates and other software" section, check "Normal installation" and continue.

Screenshot--30-

In "Installation type", check "Erase disk and install Ubuntu".

Screenshot--31-

Click "Continue".

Screenshot--32-

Choose your current location.

Screenshot--33-

Now, set up your profile.

Screenshot--34-

You'll see Ubuntu installing.

Screenshot--35-

After the installation, restart it.

Screenshot--36-

After logging in, you'll see the Ubuntu desktop.

Screenshot--40-

We have successfully installed Ubuntu in VirtualBox. It's ready to use for your future development projects.

Let's verify the installation.

Open your terminal (Press Ctrl+Alt+T) and type in the commands below and check if they work.

  1. pwd: This will print the current working directory
  2. ls: This will list all items in your current directory
Screenshot--43-

After checking those, power off your machine by using the following command.

poweroff
Screenshot--44-

Conclusion

VirtualBox is free and is a great tool for running multiple operating systems on a single OS. Ubuntu has many benefits. If you're a beginner to Linux, I would recommend you use Ubuntu as it's beginner friendly.

Please feel free to let me know if you have any questions.

You can contact and connect with me on Twitter and Medium.

Thank you for reading.

Happy Coding!