In this short tutorial, we’ll take a quick look at installing Ubuntu Operating System on a virtual machine. You may want to install Ubuntu on Virtual machine for a variety of reasons including:
- You don’t want to disturb your HDD/SSD partition structure.
- You want to create an isolated container for Development/Testing (Although Vagrant may be better suited here).
- You want share your pre-built OS and Software with other users.
- You want to test Ubuntu’s new features or are trying it for the first time. OR
- A million other reasons preventing you from installing Ubuntu natively…
Step 1: Download Ubuntu ISO
Start by downloading the latest version of the Ubuntu Distribution at http://www.ubuntu.com/download/desktop OR you can use an alternate download method such as BitTorrent available at http://www.ubuntu.com/download/alternative-downloads.
Step 2: Download and Install Oracle VirtualBox and Extension Pack
Next download and install the Oracle VirtualBox Software from the VirtualBox platform packages section at https://www.virtualbox.org/wiki/Downloads.
If you want to use VirtualBox on Ubuntu, you can install it from the Ubuntu Software Center or by using the following command in the terminal:
sudo apt-get -y install virtualbox
Also make sure you install the Oracle VM VirtualBox Extension Pack available from the above Download link. The extension pack provides additional features such as USB2.0 support, Remote Desktop Protocol Support etc. To install the Extension Pack, first download the file and simply open it with VirtualBox.
Note: USB3.0 is not supported as of this writing
Step 3: Setup a new Virtual Machine
Open Oracle VirtualBox VM Manager and start by creating a new Virtual Machine. Choose a name for your VM and Select the Type as Linux, and Version as Ubuntu (64 bit) (Assuming you downloaded Ubuntu 64 Bit edition in Step 1) and click Next.
Choose an appropriate Memory Size that would be allocated as RAM for the Virtual Machine.
Now in the next screen Choose the option to Create a Virtual Drive; next will be asked to choose the Hard drive type. Leave it at its default setting and move to the next option. Now choose the storage type as Dynamically allocated and click Next.
Next choose a Name for the Virtual Hard Disk and its Size. Set the hard disk size to at-least about 20GB so that you have sufficient space for additional data and applications. Note that although 20GB is specified, VirtualBox will not consume that amount of space on your physical hard drive as the storage is dynamically allocated and a “Copy on Write (COW)” format is used. Thus, as you install more applications and store data on your Virtual HDD, its size will correspondingly scale up to a maximum of 20GB.
You should now see a newly created Virtual Machine in the VM manager.
Now select the VM in the left panel and click on Settings. Go to the Storage tab and click on the Empty IDE Controller and then click on the small CD icon on the right side in the Attributes Panel and a drop down list will be displayed. From the list, select the Choose a virtual CD/DVD disk file… option and point to the location where the Ubuntu ISO image is stored.
You should now see the Ubuntu ISO available as a Virtual CD/DVD drive. Select OK and click on Start in the VM Manager.
Step 4: Install Ubuntu
The Ubuntu boot screen will appear and the VM will now load the Ubuntu Installer files from the ISO image. This may take some time depending on how much RAM was allocated to the VM during initial setup.
You will now be presented with two options: Try Ubuntu AND Install Ubuntu. Choose the Install Ubuntu option.
Now you may optionally select the Download updates… and the Install 3rd party software options. This will update your Ubuntu distribution to the latest available packages during installation, while also installing the Fluendo MP3 plugin for playing music. (Note that a working Internet connection is required for the updates).
Choose the default option under Installation Type screen i.e. Erase disk and install Ubuntu and click on Install Now. Select Continue when asked to confirm writing changes to the disk.
Select your Preferred Time Zone and the Keyboard layout (OR leave it at its default value) in the next two screens.
Finally type in your preferred Username, Computer name and Password, and click on Continue to start the Ubuntu installation.
Now wait for the Ubuntu installation process to complete, and once done you will see the Restart dialog. Finish your installation by clicking on Restart and have fun using your Ubuntu VM.