The Virtual Life: IE At Arms Length
The IE team was kind enough to invite me to a small launch party last night, and while there I ran into someone who was asking how you do "real work" on IE. It's a strange enough thing for a webdev to say, but the setting made it that much more interesting. I guess there's a whole generation of webdevs who would like to put their heads in the sand and pretend that IE doesn't exist. Getting to a productive point when debugging hard problems on IE requires a good toolchain. Here's my setup.
The basic pieces are:
- A high-end mac laptop, stuffed to the gills with RAM and a fast HD. Sadly the MBPs max out at 2GB of RAM today. It's a significant limiting factor when trying to work with multiple VMs
- A fast external storage device of some sort. In my case, that's a samba server with a half terabyte of soft-RAID'd disk on switched gigabit ethernet
- Windows licenses. I use both Win2K and XP. I recommend older if you can get it, just because the older the Windows version, the less RAM the OS will soak up. Configure your VMs for the minimum operating memory you can get away with, you can always bump it up later.
- Virtualization software. These days I'm using Parallels, but previously I've used both VirtualPC and VMWare. They'll all get you where you want to go so long as you can quickly make VM clones.
Before I get into the process, it helps to know that I'm not just making VM clones for the hell of it. Yes, there are things floating around that purport to let you run IE 5.5 alongside IE 6.0, etc. The fact of the matter is, though, that these aren't what your users are running. IE isn't built like Mozilla or any other browser. It really is down into the core of the OS because many of its behaviors are determined by the available versions of other components. Take, for example, the networking and javascript stacks. These are the cause of some very critical deployment-time bugs, but their behavior is determined by the versions of winsock and the Windows Scripting Host that are installed in the host OS, not the "IE version". This means that if you're not running the same version and patch-level of Windows, you're not running the same browser that your users are, and if you're not running the same browser, you can't debug the problem or come up with a workaround. To accurately debug issues, you need to be able to step through OS revs, not just rendering engine+browser chrome updates. And as if that's not enough, major Microsoft partners maintain their own IE builds. Getting reports of a problem that only shows up on Dells? There's a reason for that. In cases like this, there's really not much to be done short of buying a POS dell, but we can at least cover most of the rest of the strangeness we see in the wild with virtualization.
As for the choice of Mac, you can try to get away with something else, but if you support Safari or Mac users in general, it pays to have something that can run not just Safari, but all of the other mac versions of the various browsers your organization might care about. That, and OS X is the best desktop Unix available on the market today (sorry Ubuntu, you're not quite there yet).
Here's how I set up my environment:
- Create a new VM. In it, install/register/jump-through-MS-hoops for the baseline version of the OS(es) you're going to be using. Don't even think of running windows update or installing a service pack yet.
- Configure the VM to use the right local networking setup
- In this new VM, install the Microsoft Script Editor, Ethereal, Drip, the MS web developer toolbar and whatever other debugging tools you use universally when debugging for IE
- Shut down this VM and copy it off to your mass storage device. Give it a name like "XP_baseline"
- For each OS Service Pack, do much the same thing. Install the service pack (avoiding browser upgrades if possible), shut the VM down, and pickle it off to cold storage
- Once you've got a VM with a pristine version of the last OS service pack, start doing the same thing, but with major browser revs. If you can't find an installer for a particular IE rev, try the Evolt Browser Archive.
- At the end of the last step, you should have a "mostly" up-to-date version of both OS and browser. Once you've got a copy of that in cold storage, only then should you run Windows Update. Mmmm...watch that VM reboot!
- This is now your "working VM". Keep it on the local disk for on-the-go development and debugging. Also, keep this VM patched as MS releases updates.
- For each new major browser rev, do NOT use your "working VM" as your baseline. Instead, pull your last major browser/OS rev snapshot out of cold storage, copy it, upgrade the copy, and put that back in the drawer
At this point, you're going to have ton of space eaten up on your external drive with VMs that you might only use very occasionally, and that's OK. Disk is cheap and if you've done stuff the way I recommend, your vms are probably going to be less than 3GB in size each. Should you make the mistake of installing, say, VisualStudio then at least disk is still cheap. At this point, you're set up to respond to the thorniest bugs, and do it faster and more accurately than your co-workers/competition.
Need to test something on IE 5.5? No sweat, just thaw out that VM and give it a whirl. Clients reporting a problem on IE 6 that you can't reproduce? Try the "naked" version of IE 6. Odds are you'll be able to reproduce it there, and with some binary-search style patch application, you can pinpoint down to the individual hotfix when things got fixed.
At this point I should probably disclaim any and all liability you might incur with regards to your Windows EULAs. I'm not advocating that you violate your licensing terms with Microsoft, and depending on your agreement with them, you might be required to do something in addition to these instructions in order to stay in compliance, despite this really being a workaround for Microsoft's design-time failures. Follow this recipe at your own risk.