A few weeks ago while trying to find someone in the middle of a downpour in New York City, I borked my iPhone (iPhoners be forewarned, apparently, the smooth surface and lack of buttons has little to do with the iPhone's ability to resist water). Since I was away from home and in need of a phone that could make and receive calls, I went to the local Apple store and had it replaced with a loaner unit. Despite my expecting it, the most amazing part of the experience was what happened when I plugged the loaner into iTunes— most of my phone's state was restored from a backup including the state of the various messaging applications (SMSes, emails, read/unread, etc.). While I lost a few things (YouTube bookmarks and ringtones), the overall experience underscored the fact that more and more, the actual devices that we do our computing on are nothing more than interface and an intelligent cache, while the bulk of what matters to us today (data) is increasingly moving to the cloud.
Ok, so I cheated in that paragraph above a little bit. Most of my iPhone's state was actually stored on my Mac laptop, which today is not strictly in the cloud. In fact the Mac makes a bad case for the cloud, because its own state would be so difficult to replicate up to a server farm somewhere. Sure, I can use DotMac to backup files and the datastores of specific Apple applications (Addressbook, iCal), but most of what represents my Mac (my iTunes collection, my tweaked out DarwinPorts, my various .rc files, the rest of my installed applications) doesn't play well with cloud-based services because we currently lack a good protocol for replicating the data and machine state to the cloud.
Or do we?
I guess I must be having a bad month, because the main server I use for experiments (my own personal bit of the cloud) seems to have gotten sick somewhere in its bowels. Every few days the kernel panics and the entire machine locks up. After re-jiggered most of the software installed on it, I've now come to realize the root cause is some bit of flakey hardware on the motherboard or RAID controller. Having probably installed Linux more than 100 times over the last 10 years, I can honestly admit that the magic of building a useless bunch of PC parts into a little piece of the Internet is now all but gone, and that even in the cloud, it's probably a good idea to treat the hardware as ephemeral.
Enter virtualization. A few months ago, I remember seeing Brad Fitzpatrick enamored with the open source para-virtualization project Xen because he could just "spin off VMs for each application." However, at the time I didn't have the cycles to play with it. The intervening months have done little to make the open source part of the Xen project move forward (there is still no bootable CD version of it, most documentation is at least six months out of date, and XenSource is now on the way to the dustbin of acquire-to-kill companies). Since I didn't have quite enough patience for digging through all of that, and since I have been quite impressed by VMWare's Fusion (the Mac OSX version of VMWare's VM runner), I decide to give their free server product, VM Server, a shot.
[A parenthetical aside on those interested in Xen versus VMWare on a technical level— all others skip this paragraph: VMWare Server doesn't quite perform as well as a fully "paravirtualized" VM (like Xen) because it has one more level of abstraction between the guest OS and the hardware. In effect, a guest OS on VMWare Server runs as a process on a base (or host) OS without modification to the guest OS, and with minor tweaks to the host OS (implemented through a set of kernel modules). It's not like those old crappy CPU emulators (Virtual PC comes to mind here) in that instructions are still executed natively by the processor (which is why VMWare primarily supports Intel on Intel configurations), but you will pay a penalty, especially around IO operations. That said, for my workload, the penalty was neglible. In fact the server that pushed this page to you is running in a VMWare instance inside of an Ubuntu Linux based OS— go ahead, hit reload really fast a few times to see how much the network has become the bottleneck these days!]
To make a long story short, I now have a bunch of Linux VMs which I run on two physical machines, as well as my development laptop interchangeably. In and of itself this is nothing special, except that maybe it is interesting to see how some of us like to waste the cycles that Moore's Law gives us with an increasing number of levels of abstraction.
But back to getting my Mac into the cloud, for real. Why couldn't the OS support virtualization natively, and then let me run all of my computing on a guest OS that itself could be streamed up into the cloud? Wouldn't this then become the ultimate (albeit complicated) protocol for syncing state between client devices and the cloud?
There are interesting possibilities around a solution like this one that go well beyond backup and restore from the cloud. At a crude level, this VM-shipping is the same thing as packaging up code and data and moving it around the network. It is in effect an entire execution context that is just mine. Does it mean no more traveling with a laptop? Sure, but it also means being able to keep my computer running all of the time, whether I have it on or not. This isn't anything new for the energy-sucking desktop crowd, but as the world moves to laptops, there may be some interesting new businesses here.
To close, let me come full circle back to my borked iPhone. Naturally, there is little chance that a device that is as power and cycle-constrained as the iPhone is going to grow a virtualization layer any time soon (thought it's amazing what can be put on chips these days). The more relevant question though is: should it? Are there benefits to having every computing platform that we use be able to save its entire state in one bag of bytes that is portable, cloneable, and ultimately, sychronizable across other devices?
I'm not sure, but then again, I've definitely grown up in the simplest possible protocol age where the best thing you can do for an application is emit its data as an RSS feed. It will be interesting to think about what happens when these virtualized devices find more comfortable homes in the cloud.
Postface: I wrote most of this post at 2 am while recovering from my brother's 42nd birthday celebration but then lost it to a fibbing laptop battery (fittingly enough). It's his total and utter lack of respect for conventional wisdom (combined with more than a few drops of crazy) that I've found most inspiring in thinking more broadly than the immediate engineering problems in front of me, and for that reason this wacky entry is my way of saying: happy birthday brother.