VirtualBox is a cross-platform virtualization application. It installs on your existing computer (and operating system) and extends the capabilities of your existing computer so that it can run multiple operating systems (inside multiple virtual machines) at the same time.
So, for example, you can run Windows and Linux on your Mac, run Windows Server 2012 on your Linux server, run Linux on your Windows PC, and so on, all alongside your existing applications. You can install and run as many virtual machines as you like. The only practical limits are disk space and memory.
The whole concept of virtualization just seems a bit too geeky for most otherwise computer-friendly people. This tutorial attempts to introduce any regular computer person to the “geeky” world of virtualization.
VirtualBox is deceptively simple yet also very powerful. It can run everywhere from small embedded systems or desktop class machines all the way up to datacenter deployments and even Cloud environments.
In terms of Virtualization as a whole, VirtualBox is not the only competitor in the field. In fact, many in the tech community report that VMware’s Workstation offers more features and handles multiple virtual machines better. I have played around with VMware almost as much as I have with VirtualBox and these days, I find that I usually choose to go with VirtualBox because:
- It is free! VMware is not.
- I find it a lot “lighter” than VMware and therefore more convenient.
- It is relatively easy to set up.
- It works on all the major operating systems.
You can have a look at VMware on their official page here.
Why Is VirtualBox Useful?
VirtualBox allows you to run more than one operating system at a time. This way, you can run software written for one operating system on another (for example, Windows software on Linux or a Mac) without having to reboot to use it (as would be needed if you used partitioning and dual-booting). You can also configure what kinds of “virtual” hardware should be presented to each such operating system, and you can install an old operating system such as DOS or OS/2 even if your real computer’s hardware is no longer supported by that operating system.
Sometimes, you may want to try out some new software, but would rather not chance it mucking up the pretty decent system you’ve got right now. Once installed, a virtual machine and its virtual hard disks can be considered a “container” that can be arbitrarily frozen, woken up, copied, backed up, and transported between hosts.
By using a VirtualBox feature called “snapshots”, you can save a particular state of a virtual machine and revert back to that state, if necessary. This way, you can freely experiment with a computing environment. If something goes wrong (e.g. after installing misbehaving software or infecting the guest with a virus), you can easily switch back to a previous snapshot and avoid the need of frequent backups and restores.
Any number of snapshots can be created, allowing you to travel back and forward in virtual machine time. You can delete snapshots while a VM is running to reclaim disk space. Here’s an example of snapshots I keep on one of my VMs. Details for the “SQL Server” snapshot is expanded. Click on the image to view in higher resolution.
As you might have noticed, I take snapshots after each “milestone” as I work. I have the flexibility to branch out the snapshots however I like. As one who has often suffered from a single software installation messing up an entire server, for me, snapshots are the way to go!
Software vendors can use virtual machines to ship entire software configurations. For example, installing a complete mail server solution on a real machine can be a tedious task (think of rocket science!). With VirtualBox, such a complex setup (then often called an “appliance”) can be packed into a virtual machine. Installing and running a mail server becomes as easy as importing such an appliance into VirtualBox.
Along these same lines, I find the “clone” feature of virtual box just awesome! By cloning virtual machines, I’m able to move them from one machine to another along with all saved snapshots. If you try to imagine what it would involve to do something similar with physical machines, you will immediately see the power of this feature. Do have a look at my tutorial on moving virtual machines with snapshots.
On an enterprise level, virtualization can significantly reduce hardware and electricity costs. Most of the time, computers today only use a fraction of their potential power and run with low average system loads. A lot of hardware resources as well as electricity is thereby wasted. So, instead of running many such physical computers that are only partially used, one can pack many virtual machines onto a few powerful hosts and balance the loads between them.
Most client machines I access on the job are remote instances of virtual machines running either on cloud infrastructure or as one of many VMs installed on a single powerful physical server.
When dealing with virtualization, it helps to acquaint oneself with a bit of crucial terminology, especially the following terms:
Host Operating System (Host OS):
The operating system of the physical computer on which VirtualBox was installed. There are versions of VirtualBox for Windows, Mac OS X, Linux and Solaris hosts.
Guest Operating System (Guest OS):
The operating system that is running inside the virtual machine.
Virtual Machine (VM):
We’ve used this term often already. It is the special environment that VirtualBox creates for your guest operating system while it is running. In other words, you run your guest operating system “in” a VM. Normally, a VM will be shown as a window on your computer’s desktop, but depending on which of the various frontends of VirtualBox you use, it can be displayed in full screen mode or remotely on another computer.
This refers to special software packages which are shipped with VirtualBox but designed to be installed inside a VM to improve performance of the guest OS and to add extra features.