VirtualBox
From charlesreid1
VirtualBox is a handy piece of software that creates a virtual computer - that is, an environment in which an operating system is "tricked" into thinking it is running on an actual physical computer, but in reality is simply a piece of software (running on top of another operating system).
So, why VirtualBox, instead of VMWare, or Parallels, or Boot Camp?
- It's free AND open-source
- It's supported by a company (Oracle), making it unlikely to whither up or go away
- It doesn't require its own partition, because it stores the hard drive for each operating system in one single file (.dvi format) (this makes it easy to back up and share virtual machines)
VirtualBox Guide
Before starting the VirtualBox guide, I will explain the layout of my VirtualBox directory.
I create a directory, e.g. ~/vbox, in which I keep all VirtualBox-related files. This directory is set up as follows:
- ~/vbox - the VirtualBox folder
- ~/vbox/HardDrives - contains the virtual hard drive
- ~/vbox/Media - contains CD/DVD/disk images mounted by virtual machines
- ~/vbox/Shared - a folder that is shared between the virtual machine and the real machine
Installing VirtualBox
Downloading and Installing
A binary VirtualBox installer can be downloaded for almost any operating system, from http://www.virtualbox.org/wiki/Downloads. The installation process is typical, (requires administrative privileges on a Mac). When you're done installing it, and you run it, you'll see an empty list - there are no virtual machines.
Creating a Virtual Computer
To create a virtual computer, click "New". This starts a wizard that guides you through the process.
- Select a name for the virtual machine, and a corresponding operating system type.
- Select an amount of memory for the virtual machine.
- Create a virtual hard drive for the machine.
You should probably pick "Dynamically expanding sotrage". This will create a file that starts at size 0 and grows as the virtual computer's usage grows, until it hits the maximum file size (the final selected size of the hard drive). You can select the location of the virtual hard disk, e.g. ~/vbox/HardDrives.
- Confirm that all the details are as you wish.
Installing an Operating System
Think of creating a virtual computer as going to the store and buying a bunch of hardware to assemble a computer. When you do that, you have to install an operating system. Meaning, if you're installing an operating system that requires a license, like Windows, then you MUST have a license!
To install an operating system, you need some kind of media (a CD or DVD image, .iso format - for example, from http://www.ubuntu.com/desktop/get-ubuntu/download), and some way for the virtual computer to know about it (so it can mount it). You will see the virtual computer you created in the list when you open the VirtualBox program. If you select the machine, you can click "Settings" to modify some of the settings of the virtual machine. Click the "Storage" icon, and you'll see the hard drive (.vdi file) you created under the "IDE Controller" list.
There are a number of different things one can do from this window. First, when you pick "IDE Controller", you will see two icons: one is a CD with a green plus sign, and the other is a disk drum with a green plus sign. The former will allow you to add a CD or DVD drive to the virtual computer (if this were a physical computer, this would be equivalent to adding an additional physical CD or DVD drive). The latter will allow you to add an additional hard drive (again, this is equivalent to physically installing a second drive).
You need to add a CD/DVD drive, which is created as empty, and then point it to a CD/DVD image. When you select the empty CD/DVD drive, you can pick a CD/DVD image to mount using that drive. Click the folder icon next to the drop-down menu that says "Empty", and navigate to ~/vbox/Media (or wherever you put the CD/DVD image). Pick the .iso file you want to mount.
Once you have selected the .iso file, the CD/DVD drive will mount that .iso file whenever you start up the virtual computer. If you are done installing the operating system, and no longer need to mount that image, go back to the "Storage" settings and pick "Empty" from the drop-down box.
Finally, you're ready to start up your virtual machine. Select the virtual machine and press "Start". You will see a small window open, in which the boot sequence for your virtual machine will take place. The installer for your operating system should begin.