Installing Oracle VirtualBox on Windows

Virtual machines (VMs) are all the rage these days—and for good reason. They allow you to run multiple operating systems on the same hardware simultaneously. This is useful in both production and development environments.

In a production environment, usage of machine resources can be optimized by distributing many VMs among several large computers and load-balancing applications based on their resource needs and operating system requirements. In a cloud environment, different VMs can be dedicated to companies or user communities, thereby allowing each to have its own architecture and isolating them from each other for security purposes.

In a development environment, VMs can be created in order to develop and test a product on multiple target platforms while sharing a single development computer. Additionally, VMs can be easily transported between machines to facilitate multi-site development. The ability to create “snapshots” of a VM’s state at various points in time and roll back to previous states can be a timesaver when testing complex configuration alternatives.

As a software developer I often use Oracle VirtualBox to develop Linux applications on my Windows laptop and iMac desktop. By storing the VM’s files on an external drive, I’m able to easily transport my entire development environment—operating system, application server, database management system, development tools, libraries, etc.—from one machine to another.

In this article I’ll demonstrate how to download and install VirtualBox on a Windows 7 machine. In a future article I’ll walk you through the creation of a virtual machine and the installation of Ubuntu Desktop on it.

Host Versus Guest

Before installing VirtualBox, let me explain a little terminology. The most important concept is that VirtualBox is installed on an operating system (Windows in this case) just like any other application. The operating system on which VirtualBox is installed is known as the host operating system. In addition to Windows, VirtualBox can be installed on Mac OS X, Solaris, and various Linux distributions, such as Ubuntu, Debian, SUSE, Fedora, and Oracle Linux.

Once VirtualBox is launched on the host operating system you can create a virtual machine, which essentially represents another x86-architecture hardware platform. You can then install another operating system, known as the guest operating system, within the VM. VirtualBox supports many guest operating systems including those listed above. While it is running, the guest OS and applications running within the VM “think” they are running on their own dedicated machine. They have access to the machine’s display, disk drives, USB ports, networking, sound card, and attached peripherals, but they actually share the hardware with the host operating system.

Download and Install VirtualBox

Using your favorite browser navigate to www.virtualbox.org. You should a page similar to that below.

VirtualBox.org

You can find the VirtualBox software at www.virtualbox.org.

Click Downloads to navigate to the downloads page as shown below.

Select host platform

Select your host platform of choice. Here we choose Windows.

Click the link next to VirtualBox 4.2.18 for Windows hosts (at the time of this writing) in order to download the installation program. Save the program to your hard disk in some convenient location (the Desktop is fine). Once the download is complete, double-click the saved executable to begin the installation process. When you see the Security Warning dialog shown below, click Run.

Run the installer

Run the downloaded installer.

You will next see the VirtualBox Setup Wizard welcome dialog. Click Next.

Click Next

Just “next” your way through the wizard dialogs.

Select the location in which you would like to install VirtualBox by clicking the Browse button and selecting a folder. I’ll leave the default as shown. Click Next.

Choose install location

Choose the location in which to install VirtualBox. Here, I accept the default location in the Program Files folder.

You can choose to create shortcuts on the desktop and in the Quick Launch bar by checking the boxes. Click Next.

Decide if you want shortcuts

I usually uncheck these settings to avoid cluttering up my desktop and quick launch bar. A VirtualBox shortcut will still be available in the Start Menu.

The next dialog warns you that the installation will reset your network interfaces. At this point you might want to log off of email and any other network application you may be using. Click Yes.

Install resets netword connections

The installation does reset your network interfaces so you may want to close network connections ahead of time.

On the following dialog, click Install.

Click Install to begin

Click the Install button to begin that installation.

A progress indicator will keep you apprised of the installation process.

Installation progress indicator

The progress indicator lets you know how it’s going.

Once the installation is complete, you can choose to launch VirtualBox by checking the box. Click Finish.

Click Finish to complete the installation

Once installation is complete, click Finish and you’re done.

Create a Test VM

When VirtualBox is launched, you will see the VirtualBox Manager screen where you can manage your VMs. Once you have created some VMs they will be listed in the left pane. Let’s create an empty test VM to demonstrate the process. Click the New icon as shown below.

VirtualBox Manager screen

The VirtualBox Manager screen allows you to manage your virtual machines. Here, you can create new VMs, remove them, start and stop them. Once there are some VMs to work with, you can also adjust their settings from this screen.

This will fire up the Create Virtual Machine wizard where you can enter the name of the VM, its type, and version. Enter the values shown in the screenshot below and click Next.

Name and operating system

Enter the name, type, and version of your VM.

In the next step you can enter the amount of memory your VM will require. This will be based on the amount of physical memory that is available on your machine, the requirements of the host and guest operating systems and applications, as well as the number of VMs that you expect to run concurrently. On my machine I have 8GB of physical memory. For this test I’ll allocate 2GB of that to my VM. You can enter the amount of memory using the slider control or by typing the value (in MB) in the box provided. Click Next.

Memory size

Enter the amount of memory to allocate to your virtual machine.

On the next dialog, you create a virtual hard drive. This virtual drive will be implemented in a container file on your hard disk, but it will be presented to the VM as if it was an actual drive. Select Create a virtual hard drive now and click Create.

Hard drive

Create a virtual hard drive during VM creation by selecting this option.

On the Hard drive file type dialog that appears next select VDI (VirtualBox Disk Image) and click Next.

Hard drive file type

If you don’t plan on using this virtual drive with another VM product, keep the default format of VDI.

On the Storage on physical hard drive dialog you can tell VirtualBox whether you want to pre-allocate the space for the virtual hard drive or allow it to grow dynamically. Choose Dynamically allocated and click Next.

Storage on physical hard drive

By selecting this option the virtual hard drive container file will start small and grow as needed.

The next dialog allows you to specify where to store the container file that will implement the virtual hard drive. Leave the default of My First VM and set the size to 20GB. Click Create.

File location and size

Specify the location and maximum size of the hard drive container file.

The VirtualBox Manager will now display your VM in the left pane and its settings on the right. Click the Start button as shown below.

Start up the virtual machine

Start up the virtual machine.

VirtualBox now prompts for some sort of media to boot an operating system. If you happen to have an Ubuntu DVD laying around you can go ahead and insert it into the drive and boot it. However, for this test I’ll just click Cancel.

Select start-up disk

We won’t boot an operating system for this test VM.

The VM will start but, without an OS to boot, it just immediately halts as shown below.

No bootable image

The VM starts but finds no bootable image.

You can close this window and power off the machine.

Power down the virtual machine

Power down the virtual machine.

Back on main screen right-click on the test VM you just created and click Remove from the context menu. At the subsequent prompt click the Delete all files button to remove the VM and its associated files.

Remove all traces of the test machine

Remove all traces of the test machine.

In this article, we did a quick install of VirtualBox on Windows. We also created an empty VM to show the process. In the next article, we’ll create a VM and install Ubuntu, one of the most popular GNU/Linux distributions. I’ll be using this environment for the WordPress Database Deep Dive series that will kick off soon.

Speak Your Mind

*