VirtualBox and virtual machines
VirtualBox is software that runs on Windows, OS X, Linux, and Solaris, capable of full virtualization. Full virtualization allows VirtualBox to run OSes entirely different than the OS it is running on top of. The app can do this using the magic of virtual machines (VM), because each machine runs its own OS internally.
For example, a Mac or Windows user can use a VM to run a Linux distro without a need to change or modify the underlying host computer in any way. This is especially attractive for Mac users not wishing to use Boot Camp, or Windows users not wishing to repartition a drive, configure a bootloader, or run Linux from a USB stick.
Oracle, the maintainer of VirtualBox, has created a variety of virtual machines you can download for free, each configured with different database and/or web server options, all running Oracle's Linux distro. Other online sources also host downloadable VM's installed with distros other than Oracle's, but there is are no guarantee's these third-party VM's aren't laden with spyware or other nasties.
So what are the options available if you wish to run a virtual machine installed with your Linux distro of choice? You can gamble on using a third-party VM, or you can create one yourself with a Linux distro's installation ISO (disk image) file.
Obviously, you first need to download VirtualBox, as well as an ISO from the webpage of your favorite Linux distribution. I chose Slackware Linux, version 14.1 for x86. In Slackware's case, the ISO (slackware-14.1-install-dvd.iso) can be downloaded either from an official mirror or finding the image on Slackware's BitTorrent page. So, I used BitTorrent on my iPad to download the Slackware 14.1 x86 DVD ISO. Why 32-bit? Generally, 32-bit Linux distros are smaller, this helps keep VM size pared down to a minimum.
Be sure to download a full DVD ISO if possible, as a full ISO file makes installing Linux on a VM much, much easier as you will shortly see.
In rare cases, you may not need to install VirtualBox. For example, Andy the Android emulator installs VirtualBox along with an Android VM, so you may wish to check your system beforehand in order to save a little time and effort.
Create a new VM
Click VirtualBox's Add toolbar button, give the VM a name, and set Type to Linux, and Version to Other Linux, with the appropriate bit (32 or 64) parameter matching your distro.
Allow the OS a decent amount of memory, 512MB should be sufficient, but I chose a full GB.
Next, select the Create a virtual hard drive now option and pick VDI (VirtualBox Disk Image) as the hard drive file type.
VirtualBox supports dynamically allocated hard disks which allows VM drives to increase in size if needed, however I've found this option can cause some Linux distro's problems during installation. So, to be on the safe side, pick the Fixed size storage option.
Next, specify disk size. Most of the time the recommended 10GB is sufficient, but this can be adjusted depending on your needs.
VirtualBox will then create a disk image, and after it is finished right-click the VM and choose Settings...
...and choose System, Motherboard.
At the bottom of the Motherboard tab, ensure Hardware Clock in UTC Time is enabled. Some flavors of Linux or *nix installations can go awry if this option isn't set.
Next, click the Processor tab and be sure to check the Enable PAE/NX box. If left disabled, this option is usually the "deal killer" that halts Linux installations on new VMs.
Select the Storage category, and add the DVD ISO file you downloaded from the Linux distribution homepage as the IDE Secondary Master drive.
The important settings are configured, but you might want to double-check Network, USB, and Serial Port settings to match the hardware configuration of your machine, but generally speaking, most of the time these settings rarely need adjustment.
Installation and further guidance...
Click Start to begin installing Linux to your Virtual Machine.
This article is published as part of the IDG Contributor Network. Want to Join?