VirtualBox is a very good Type 2 hypervisor

Have you ever wanted to try that new operating system version everybody is talking about, but don't want to mess up your PC? Or maybe need to learn how to use Linux's command line but don't want to lose your gaming friendly Windows? A virtual machine might help you a lot!

Underlying the rise of cloud technologies, systems virtualization stands as one of the foundation blocks of modern data centers, mainly for allowing an optimum hardware efficiency on SMP servers.

If you didn't understand any of the above is probably because you're not an IT infrastructure expert , but don't worry, most of us aren't neither. The good news are that you still can take advantage of virtual machines on many frequent not-so-technical-scenarios:

  1. Running multiple operating systems simultaneously.
  2. Creating development sandboxes where you can experiment without the concern of losing any data.
  3. Data recovery and easier software installations or deployments.

Most of the entry and mid level computers sold by any retailer have enough hardware resources to accommodate a host and a guest OS running simultaneously. The easiest -and cheapest- way of creating your own virtual machines is by installing a hypervisor or virtual machine monitor (VMM) on your desktop or laptop PC, and one of the best choices in the market, VirtualBox, also happens to be free!

I have used VirtualBox for about three years now, mainly to test operating systems, take screenshots of installations, and to run Windows software when using Linux as main operating system; and after working recently with equivalent proprietary solutions, I must say that for the price ($0) VirtualBox is a very complete package that offers more options than the common user would ever need (assuming a common user would take the time to install a virtualizer software!)

This time, we'll install VirtualBox in a Windows host computer, and will use it to create a guest Linux virtual machine. As said before, virtualization is a great way of testing that operating system you've heard about for so long, but never tried because you felt afraid of dis-configuring your computer somehow. VirtualBox official hardware requirements are not very specific, and that's because everything depends on the combination of host/guest(s) you plan to install. However, my personal recommendation in that you have at least 2Gb of RAM, a multicore CPU (if it supports virtualization, even better!) and 25Gb or more of free disk space.

First, download the latest VirtualBox version from https://www.virtualbox.org/wiki/Downloads and run the installer.

VirtualBox installer

During the installation you will receive an alert message about the network interface and getting disconnected from the Internet, don't worry too much about it since this is nothing else than a virtual network card being installed and your connection (if drops) will be restored within seconds. This virtual interface works as gate between the host and guest operating systems, giving network access to the second one and also making possible folder sharing among them.

Once the installation is completed, go ahead and execute VirtualBox, you will be presented the welcome screen, which means you are ready to start creating virtual machines :

VirtualBox welcome screen

For this tutorial, we will create a Kubuntu Linux virtual machine, and you will need an .iso image that can be downloaded from: http://www.kubuntu.org/getkubuntu. I will use the LTS release, but feel free to pick the latest one if you want to.

Creating and configuring the new machine.

1- On VirtualBox, click on New button. A new window named Create Virtual Machine will pop up.
2- First, you need to set up Name and operating system, do it as shown in this screen capture and click on Next.

Machine name and type on VirtualBox

3- Now we will allocate RAM for the machine, on Memory size step, set the slider for 1024Mb.
4- On the Hard drive step, select Create a virtual hard drive now option and click on Create.
4.1- On Hard drive file type, select VDI (VirtualBox Disk Image), click Next.
4.2 - On Storage on physical hard drive option, select Dynamically allocated, click Next.
4.3 - On File location and size, keep the default suggested name and size for the VDI (same as machine's name and 8GB) and click on Create button.

Now you will go back to main screen, and the just created VM appears listed on the left side of the screen. We need to fine tune it a little bit more before turning it on. Click on the Settings button.

VM listed on the left side of VirtualBox

5- In the General section, click on the Advanced tab and set the Shared Clipboard option to Bidirectional.

Bidirectional shared clipboard on VirtualBox

6- In the System section, click on the Motherboard tab, then set Pointing Device to PS/2 Mouse.
7- Still in the System section, go to Processor tab to allocate CPU resources using the Processor(s) slider, in our case we'll assign two of the eight available virtual cores. Also check Enable PAE/NX.

Setting processors on VirtualBox

8 - The final step in the System section will be in the Acceleration tab, there you need to check both of the available Hardware Virtualization options: Enable VT-x/AMD-v and Enable Nested Paging.
9- In the Display section, allocate Video Memory to around 32Mb and check Enable 3D Acceleration among the Extended Features.

Last step is to set up the CD/DVD drive of the new VM, which we will load with the Kubuntu image we downloaded before.

10 - In the Storage section, click on the CD(Empty) icon in the Storage Tree, then in the Attributes section click on the Choose a virtual CD/DVD disk file... option to navigate to the location where you saved the downloaded Kubuntu file and select it. By doing this, you're telling VirtualBox to load the .iso file into the CD/DVD drive of the virtual machine when it is turned on.

Loading a .iso file in VirtualBox

These are the essential parameters you need to modify to run Kubuntu properly, but as you probably noticed by now, if we were installing a different guest OS, we would need to set a different configuration. Click OK to apply preferences and then Run to start the machine.

The virtual machine will boot up from the Kubuntu image and from there you will be able to install it as if you had a real physical DVD inserted into a real physical computer. The installation procedure for Kubuntu 12.04 goes beyond the scope of this article but you will find it is as easy to install as any MS Windows version.
After the installation has concluded (30min~45min), you can start using your new machine simultaneously with your host operating system, and since Linux distribution utilize hardware resources so efficiently, a quick look at the Task Manager confirms we still have spare resources to install a second VM.

Hardware resources utilization of VirtualBox

In a second tutorial we will show you how to adjust the screen resolution to make it use all the available landscape when entering fullscreen and will also dig a little bit deeper on some of the most useful functionalities of VirtualBox such as Appliances.

Stay tuned for Part II!