Syncing your Zune in Mac OS X, running Word in Linux, giving Linux a go within Windows 7: just a few of the things you can do with virtual machines. Setting one up isn't just easy, either—it's free.
The word virtualization conjures images of the dank nerd lairs, populated by lonely network admins, scattered with miles of grey wire, grimy PC towers, processed food packaging and tiny tumbleweeds woven of human hair. It sounds like the domain of the software nerd, the Gentoo jockey, and most importantly, not you. Today, though, virtualisation has become amazingly easy, and fantastically useful.
Terminology aside, here's what desktop virtualisation means today: You can run just about any OS, Mac OS X excluded, inside any other OS. Ubuntu in Mac OS? Sure. Windows 7 within Windows XP? Why not? Windows ME within Snow Leopard? Nobody's going to stop you, I guess! And these patchy, half-assed experiment we're talking about here—these are fully-functioning installations, which'll connect to USB peripherals, access the internet, share files with your host OS, and run almost any software you could run on a native installation. You can set up as many of these things as you want, and delete them in a matter of seconds.
Best of all, virtualisation is now something you can try—and stick with—for free, thanks to software like Sun's VirtualBox. It's a free download on any platform, and it does its job spectacularly. Here's how to get started.
What You'll Need Free hard drive space: VirtualBox is going to create a simulated hard drive (a hard drive image, to be specific) inside your current OS's operating system. In other words, you'll need to have space handy to hold a standard OS install, plus whatever apps you're planning on using on the host system. 10GB is enough to play around with in most cases.
Lots-o-RAM: As efficient as modern virtualization is, running one OS inside another isn't going to be easy on your hardware. The easiest way to ensure good VM performance is to have plenty of RAM, such that both OSes—your host one and your guest one—can have more than their minimum recommended amount of RAM.
VirtualBox: This is the virtual machine, or the program in which all of your virtual OSes will run. Getting it is just a matter of downloading the correct version—there are Windows, Mac and Linux versions—and running an installation wizard.
A guest OS: Installing an OS as a virtual machine is almost exactly like installing an OS natively, albeit slightly easier. In other words, you'll need a full, licensed version of your OS, in whatever form you can get it. Downloaded ISO images will work right out of the, er, box—this is how most Linux distributions will come packaged—while OSes on a CD will work too, including your Windows install discs. If applicable, you'll still need to enter licence keys—as far as Microsoft is concerned, this is a fresh installation of an OS.
Installing Your Virtual Machine I've chosen to install Windows 7 within OS X Snow Leopard for this guide, because this will be a common usage scenario, and because the processing of installing an OS in VirtualBox is nearly the same no matter which software you're running on either end. In other words, if you're installing Ubuntu 9.04 within Windows XP, you can still follow along. Anyway, here you go:
VirtualBox supports so-called "Guest Additions" in some OSes, which are essentially sets of tools and drivers that make the virtualization more seamless. If they're available, you'll want to install them: the guest OS will adjust to your screen resolution properly, your video performance will be smoother (and in Windows XP and Vista, possible accelerated), filesharing will be simplified, copy and paste will work between OSes, and in some cases, you'll even be able to run individual programs as native windows in your host OS, not just inside the cordoned-off virtual machine window.
If you're running Windows inside Mac OS or Linux, you may as well try this. It's not quite perfect—the Start Menu stacked atop the Dock is a little awkward—but at least this way you don't have to alternate between desktops. It's a cool effect, at the very least.
To install Guest Additions, click "Install Guest Additions" under the "Machine" menu while running your virtual machine. Guest Additions should appear in your guest OS as an optical disc, which should contain an installer. Run it, then restart your virtual machine. Once Guest Additions are installed, you can access Seamless Mode from the VirtualBox menu, under "Machine."
Copy and paste will often work between the host and guest OS, but if you're planning on using your guest OS for productivity, or sharing media, a shared folder is the only real solution. In the bottom right corner of a running virtual machine, you should see a small folder icon. Clicking it will bring up a shared folder creation dialog. Select where on your host OS your shared folder should be—it can be an existing directory, like your "Music" folder, and check the box to make it "Permanent." On your guest machine, the shared folder will show up as a VirtualBox Shared Folder in your local network.
One of the most common reasons for installing a virtual machine is to circumvent some kind of driver incompatibility. VirtualBox recognised most of your computer's inbuilt components, like sound cards, extra storage or webcams, and can use them automatically. For most USB devices, though, you'll need to tell it when to take control.
In most cases, this just means making sure your device isn't in use by your host OS (a flash drive will need to be unmounted, for example), and clicking the small folder icon in the bottom right corner of the screen. This will bring up a list of available connected devices; simply click the one you want, and you're good to go.
Odds and Ends Virtualising isn't just a good way to get around some kind of nagging compatibility problem, it's a fun way to wile away a few hours experimenting with weird news OSes. Setup is just about the same no matter what you're installing, so there's really no reason not to try some of the more esoteric software out there—anything with an ISO available for download will do. For a taste, try the Haiku Project—a revival of the long-dead BeOS, or see what the hell FreeBSD is.
If you have more tips and tools to share, please drop some links in the comments-your feedback is hugely important to our Saturday How To guides. And if you have any topics you'd like to see covered here, please let me know. Happy virtualising, folks.