Writing an operating system book using virtual machines

Running multiple Linux virtual machines simultaneously for research purposes works like a charm

I was struck by Alex's article on software development using virtual machines. His tl;dr conclusion was that "using a VM to develop software has a lot of advantages, but it is not quite ready for prime time yet." I've just finished a similar experiment, but I was writing a book rather than doing software development. I needed virtual machines for several reasons:

  • We cover six UNIX and Linux operating systems, but our lab only had a Solaris system, an HP-UX host, and an AIX server. I needed to test and research on three Linux distributions as well (RHEL, Ubuntu, and SUSE).
  • The book is written in Framemaker, which is no longer available for OS X. I needed a Windows VM on which to run it.
  • I had some special networking needs that were easily enabled by virtual machines.
  • I sometimes like to work without network connectivity, but I still need access to Linux machines for research purposes.

My final virtual machine tally included several guests. I used each of the following during some stage of the writing and research process:

  • Windows XP SP2 - Running Framemaker and Tortoise SVN, our version control system for shared use of frame files.
  • Windows Server 2008 - Use to create a domain controller for testing Active Directory authentication using winbind.
  • Windows 7 - Client to authenticate to Windows Server 2008, also for file share testing.
  • SUSE Linux - Test SUSE system.
  • CentOS 5 - Test RHEL/CentOS system.
  • Ubuntu 9.04 - Test Ubuntu system.
  • OpenSolaris 2009.06 - Test OpenSolaris system.

Like Alex, I started with Parallels, but quickly became frustrated with a number of issues. (These complaints apply to Parallels 4. I had moved to VMware Fusion by the time version 5 was released.) I had spotty success with the Coherence, a feature that puts applications in Windows side-by-side with the OS X apps, outside of the virtual machine. This is a great feature for writing, since I could just run a Framemaker window as if it was another OS X app. Unfortunately, mouse support was hit or miss, and the two finger scroll didn't work. I had problems starting up suspended guests; they often needed a reboot. I used the VMware Fusion (version 2, before version 3 was released) importer tool to convert each of my guests, and I stuck with VMware Fusion version 2 for the remainder of the book's development. I didn't have any problems after the conversion, and my primary complaints were resolved. Still, a couple of observations:

  • I have a bug with VMware's Unity feature (identical to Parallels's Coherence), that occasionally causes graphics problems with Windows applications, but it's easily resolved by swapping to full screen mode and back.
  • Windows regularly reports that it's low on swap space, regardless of how much memory I allocate, but this never actually impedes the system.
  • With 4GB memory I was able to run up to four guests without significant performance impact.
  • Notably, suspending systems is quite slow, particularly if you try to suspend multiple guests at once. Perhaps the biggest drawback I found with this model was laptop battery life. I'm running a Macbook Pro (late 2008), and I get marginal battery life at best. Add a running guest VM and battery life drops to around an hour. Any more than that and I definitely need power. Other than battery life, the performance of guests on my Mac is excellent. The guests are not going to win any benchmark contests, but for my research purposes they were absolutely sufficient. My needs involved both X and command line use, regular booting and rebooting, software installation, disk management, and various network services. I usually suspended each guest after a work session and only rebooted as necessary during research or occasionally for Windows updates. In short, writing The UNIX and Linux System Administration Handbook on a set of VMware guests simplified my life. I had portable Linux (and Solaris) machines at my whim, enabling me to write even without network connectivity. I sometimes like to pull out my laptop and work on the plane, but the battery life limitations prohibited working on the book that way. In Alex's article he determines that VMs aren't quite ready for daily software development needs. In my case, it worked beautifully. YMMV.
Join the Network World communities on Facebook and LinkedIn to comment on topics that are top of mind.

Copyright © 2010 IDG Communications, Inc.