Virtual machines at home: tinkering without the risk

If your computer use and skills fall into the home or work user category, all the hype over "virtualization" has probably gone mostly unnoticed. If you've heard the term at all, it's likely been in the context of something your company is doing with their servers, or perhaps something that a geek friend was fiddling around with. But virtual machines- essentially, complete and independent virtual computers existing within the operating system you're familiar with- can be an incredibly useful tool for home users as well.

Let me ask you this: Have you been thinking of trying out some form of Linux or Unix, but you don't want another box on your desk and you don't want to break your existing machine? Or perhaps you'd like to dig around the juicy bits of your operating system a bit, tweak things, try to figure out just what sysadmin geeks are doing in their server-filled closets. But, of course, few of us dare to fiddle with a working machine, lest we break some critical system file and crash the whole works.

Enter the virtual machine, or VM. Odds are you already have at least one of these, even if you don't know it: the familiar Java framework runs in its own VM. The idea of a VM is to make whatever's running inside it think that the VM is the entirety of the computer: it's an isolated lagoon over which you have complete control. Nothing inside the VM has any idea that the rest of your computer even exists, and your normal (or "host") operating system can only see the VM through specific channels defined by the VM software.

The home user's need for virtualization thus becomes obvious: if you want to learn how to tweak (and fix) your system, you need a place where you can fiddle around without consequences. Break a real machine's operating system, and you're stuck with hours of careful fiddling to get it running again. Break a VM, and you can restore it to a "snapshot" of a working state in seconds. The screenshot below illustrates the power of this approach: what you see here is Firefox running under the Unix-based OpenSolaris operating system, a window with a Linux Mint installation, and a MySQL server in Ubuntu Linux, all easily controllable from- but isolated from- their Windows 7 host.

screenshot of two Linux and one Solaris VMs under Win7/VirtualBox

What you need

The core of the VM system I'll talk about here is what's known as a type-2 hypervisor. This is a bunch of code that runs in your existing operating system, just like any other program, and forms the bridge between your physical computer and the virtual machines. VMWare Workstation, or my personal favourite, the free VirtualBox will handle this job.

You'll also need a suitable host computer. If your machine is more than a couple of years old, it probably doesn't have the hardware virtualization features needed to make this work well. It'll still work, just slowly. You'll also need enough RAM to run your virtual machine- at least half a gigabyte- in addition to what your existing operating system needs.

Finally, you'll need *.iso disc images for the guest operating systems you want to run in your virtual machines. Since almost everyone now has x86 or x86-64 hardware in their home computers, finding something that'll work isn't hard: finding what you want, though, might involve a bit of sifting through online reviews of the various Linux distributions (hint: if you're new to Linux, start with Ubuntu or Mint until you learn the ropes). Of course, you can also run virtual Windows, DOS, BSD, or many other systems. Virtual Mac OS X, though, is out- Apple's licensing policy strictly forbids it from being used as a guest, although other operating systems can run as guests on Apple computers.

Setting up the hypervisor and installing your guest operating systems is a procedure that's well documented in the help guides that come with the hypervisor software. And it tends to be no more difficult than installing any other piece of software.

What to do with it

Now that you have this virtual machine to play with, you can do just about anything you want with it- without fear of breakage.  Because, as soon as you get it running, you can take a "snapshot"- a record of exactly what the VM's virtual hard drive looks like, bit for bit, at any given time.  If you break something, you can try to fix it within the VM- learning how to repair the OS as you go- or you can just restore the last working snapshot.  Think of it as an "undo" button for the whole VM.

You now have a free, easy way to try new operating systems, learn how to manage the juicy innards of a computer, and play with a large selection of Linux-based software that few Windows or Mac users ever bother to try. It's certainly worth checking out, even if you don't consider yourself the tech-savvy geek type.

Topic: 

Technology: 

Comments

The first time I've used a

The first time I've used a virtual box was to test an exe file which I suspected to be a virus and didn't want to run it directly on my computer and I liked it so much that I use it ever since. Lately though I have learned that virtual boxes also have their own vulnerabilities so I had to check out if there are any virtualization security news. I am happy I looked for more details though, because now I can continue using my virtual box without any fear.

Suspicious files

Matthew's picture

Yep, VMs are great for "suspicious" files. They do have their vulnerabilities, but it's much easier to clean and rebuild a VM than a live, physical machine. (One could also go a bit crazy and have some fun with VM-borne malware: http://xkcd.com/350/ ).

Add new comment