Virtualization and the Throw-away Computer
A week ago I would be livid if someone walked up to my work desk, ripped my computer out from under it, and threw it in the garbage. Today, not so much.
It's not that I care about the physical hardware. Not a bit. That thing is over 3 years old now! If you translate that from human years to computer years the hardware itself is decrepit. I'd love to such a visceral reason for a new machine.
It's not that I care about the data. I've backed that up and store code in our version control system and on GitHub. Storage is cheap.
It's the operating system and the configuration of all the software and tools I use. Being a developer means having a wide range of software configured: from text editors and IDEs like Eclipse, to servers like Apache and MySQL, to utility applications like SSH/SCP, git, etc, to all the libraries PHP 5.3 needs to be compiled from source. Downloading, configuring, and faithfully reproducing my existing workstation setup would take the better part of a long, boring day. Not anymore.
Learning about Viruses and "Hacking" Opened My Eyes
In graduate school I took a course on computer systems security. Our assignments were tasks like writing programs that fought off viruses from an infected machine, broke into a digital rights management scheme, and one involving a free-for-all "write programs to hack into each other's" machine contest. When the professor revealed, "You'll be doing this work on either your office computers in the iLab," I had no question where I would work with viruses: not on my machine, no sir, no way. I was wrong.
What I didn't know is that all of the classwork would be done on virtual machines. A virtual machine is, as the name implies, a full-blown emulated computer that runs "sandboxed" on your desktop. Virtual machines allow Mac users to enjoy Windows from within OSX, they allow Linux to be run on Windows, and generally allow you to run virtual computers with whatever operating system you please. What happens in a virtual machine stays in a virtual machine, unless you want to bring it out. So things like valuable files you bring home, things like viruses stay in the VM. Virtual Machines are like Vegas for computers, but better.
The eye-opener was that virtual machines can be backed up, deleted, and restored just like files. They are throw-away computers. When the virus won the battle we "threw away" the machine which meant opening another file. When we needed to submit a machine for grading we didn't lug a big box to the professor's office, we sent the VM image file over the network.
The Commoditization of Memory, Multi-core and Virtualization Software
The two big requirements to work with virtual machines are: 1) they use a lot of memory and computing power, and 2) virtualization software. In recent years both of these requirements have become commoditized. Last weekend I bought a 64-bit quad-core Core 2 Intel box with 4 gigabytes of RAM and over half a TB of disk space for $450. That's crazy. I then installed VirtualBox, an open source virtualization platform from Sun that runs on Windows, Linux, and Mac, for $0. Equipt with the tools I set out to build a throw-away desktop.
The only non pre-installed programs I installed on the primary OS is VirtualBox and some simple utilities. After that, all work has been done within a virtual machine. After installing Ubuntu I made a back-up that I can go back to for a fresh OS. I then scripted the install of all of my necessary developer tools, servers, etc, (and posted the scripts to GitHub for anyone interested). Finally I setup a backup for the virtual machine images to an external USB hard drive. The result? Throw away my home desktop. No biggie. In fact, I'm writing this blog post on that virtual machine I setup on my home desktop but running it on my laptop with everything I need. That's just it, being able to throw away a computer isn't the big win, it's the flexibility and the freedom to do things like:
- Transfer your VM from one machine to another. No more excuse you can't do something because the program you need is on machine X.
- Install new programs without fear that they'll bloat your machine and take it down. If they do, big deal, throw it away and open up a previous backup.
- Test how applications/web pages work with other operating systems and internet browsers.
- Have a shared workstation setup that your team can use that ensures everyone has software installed and configured consistently, even when team members prefer different operating systems
Here at New Media Campaigns our developer team is on the verge of migrating to a throw-away computer setup. As our experience with virtualization grows we'll write more on the specifics of getting set up, and using virtualization technology to power the development environment of small teams. You should subscribe to our developer blog if you're considering or in the process of such a move, too.