How to install Ubuntu Linux in Virtual Box

This tutorial explains how to install Ubuntu Linux in VirtualBox step by step with practical example and screen shots. There is no need to buy a separate PC or Laptop for Ubuntu Linux. We can install Ubuntu Linux in Windows system. Virtual Box allows us to install, test, run and use Ubuntu Linux directly from Windows system.

This tutorial assumes that Virtual Box is installed Windows system. If you want to learn how to install Virtual Box in Windows and Linux, check this tutorial.

How to install VirtualBox in Linux and Windows

It explains how to install Virtual Box in Windows and Linux step by step with examples.

Creating Virtual Machine for Ubuntu Linux

Open Virtual Box Manager and click New. This will initiate the “Create Virtual Machine” wizard. On first screen of wizard we have three options: -

  • Name: - Allow us to assign a descriptive name for this virtual machine.
  • Type: - Type of operating system which we want to install in this virtual machine.
  • Version: - Version of selected Operating System Type in above field.

Set a descriptive name in Name field, select Linux from Type drop down, select Ubuntu from Version drop down and click Next button

create virtual machine for ubuntu

In next screen, we have to specify the size of memory which we want to allocate this virtual machine. Based on Selected operating system and available physical memory, wizard will automatically calculate the recommended memory.

We can use the recommended memory size or can adjust the memory size to match with our individual requirement.

If require, adjust memory size (with slider or input box) or keep default recommendation and click Next button.

virtual machine memory

In next screen, we have to select how we want to attach a hard disk in this virtual machine. We have three choices here: -

  • Do not add a virtual hard disk: - This option does not add any hard disk in this machine.
  • Create a virtual hard disk now: - This option create and add a new hard disk in this machine.
  • Use an existing virtual hard file: - This option uses previously created virtual hard disk.

If you want to use this machine as disk less machine, select first option. If you want to use this machine as a complete instance of physical machine, select second option. If you already have a virtual hard disk created through VirtualBox or other supported software (Microsoft Virtual Machine, VMware workstation, etc.) and want to use that hard disk in this virtual machine, select third option.

For this tutorial, select second option and click Create button.

create hard disk

If second option is selected, in next screen, we have to select the type of hard disk. Wizard can save hard disk file type in three formats: -

  • VDI (Virtual Box Disk Image): - This format is used by Virtual box.
  • VHD (Virtual Hard Disk): - This format is used by Microsoft Virtual PC.
  • VMDK (Virtual Machine Disk Image): - This format is used by VMware workstation.

If you are going to use this virtual machine only in VirtualBox, keep default option otherwise select the appropriate option and click Next button.

hard disk type in virtual machine

In next screen we have to select the way which Virtual Box should use while allocating assigned disk space in virtual hard disk from physical hard disk. We have two options here; Dynamic and Fixed size.

In Dynamic option, assigned space will be allocated relatively as actual space consumption grows in virtual hard disk. In Fixed size, all assigned space will be allocated in starting. For example, suppose we assigned 10GB disk space to virtual hard and virtual hard disk is consuming only 2GB space then, in dynamic option only 2GB space will be used from physical hard disk while in fixed size option entire 10GB space will be used from physical hard disk regardless how much is consumed by virtual hard disk.

Select Dynamically allocated option and click Next button

hard disk type

In next screen we have to specify the size and location of hard disk. We can use slider (or input box) and browse button to specify the size and location of hard disk respectively.

Adjust both settings and click Save and Create.

hard disk location

In few seconds wizard will create new virtual machine with selected options and list it in left pane of Virtual Box software’s main screen.

virtual machine created

Installing Ubuntu Linux VirtualBox

To initiate installation process, we have to boot virtual machine from Ubuntu ISO image or DVD. In order to boot virtual machine from Ubuntu ISO image or DVD, we have to adjust boot device priority.

Select the recently created virtual machine from left pane and do right click. From right click context menu click Settings

vritual machine setting

In opened window click System option in left pane. In right pane click Motherboard tab. In boot order option set Optical as first option and Hard Disk as second option.

boot order in virtual machine

If you have Ubuntu ISO disk image copied /downloaded in hard disk, you can also use that image file to install the Ubuntu.

To use an ISO installation image file select Storage option in left pane.

In right pane select IDE controller and use Browse button to select the ISO image file.

mounting dvd virtual machine

Now click Start button to start this machine.

start virtualbox

You can also mount Ubuntu ISO image file in optical drive from machine options.

mounting installation disk from devices

In few seconds machine will boot with selected / used Ubuntu installation disk image or DVD.

On first screen of installation wizard, we have two options: -

  1. Try Ubuntu: - This option allows us to use Ubuntu without installation.
  2. Install Ubuntu: - This option allows us to install the Ubuntu in hard disk.

If you only want to access the system without installing/modifying anything in hard disk use first option. This option gives us a fully functional operating system with complete access to hard disk. This option is usually used to access the system and hard disk in emergency situation.

Since we are installing Ubuntu in hard disk, click second option.

installing ubuntu

Ubuntu installation process involves several steps and configuration options which need to be explained individually. Due to length of this tutorial, all installation steps are explained separately in following tutorial.

How to install Ubuntu Linux step by step Explained

That’s all for this tutorial.

ComputerNetworkingNotes Ubuntu Linux Tutorials How to install Ubuntu Linux in Virtual Box