I use virtual machines (VM) for nearly all my development. When I am doing any serious work, the first step is to fire up VirtualBox on my desktop and launch the VM that I am using for that project. If you don’t do this yourself, it may seem kind of silly to run a desktop OS inside your desktop OS so you can run a few standard development programs. Once you start doing though, you quickly realize that there are a lot of benefits.
- Environment Stability — No matter what crazy software you install on your desktop computer, your real work environment in the VM can stay clean and focused. Tool upgrades needed for one project won’t break things in an unrelated project.
- Disaster Resistance — Eventually in every computer’s life there comes a time for major maintenance. When you decide it’s time to start from scratch with a clean OS, having your development environment in a VM means that you don’t have to reinstall and configure all your critical software to become productive again.
- OS Independence — It’s not cool to like Windows, but it is what I’m used to. Even if I liked a more hacker approved OS like Linux or the aesthetically pleasing OSX, it’s not going to match every one of my production environments. I write software that is deployed to different platforms and it’s great when I can match my dev environment to the target, be it Windows or some particular version of Linux.
- Maintenance Mode - A lot of my projects are in a fairly entrenched maintenance mode. So once or twice a week I have to jump in make some small change, test, deploy and then get back to other things. Having a VM devoted to that project lets me leave my IDE, command shells, FTP clients, etc. open to the project. When I’m done working I suspend the VM with everything open and ready to go the next time I have to make a tweak here or there.
- Tool Partitioning — As I’ve said, I work on a lot of projects a once. Some for work and some for fun. Some use PostgreSQL, some MySQL, some MS SQL Server. Installing every tool, every front end, every database on a single desktop PC is not at all a good idea. By using one VM for each paradigm I don’t have any single system weighed down by every flavor of technology stack.
There are a few free tools that you can use to get started with VM based development. I use VirtualBox but VMWare makes a number of free products that fit the bill. If you use Linux on your desktop you have a number of additional options like Qemu and Xen.
Licencing can get a bit tricky. Obviously for Linux based VMs you don’t have to worry much. For Windows the worst case scenario to keep in strict compliance would be to purchase a licence for every VM. A cheaper option for an independent developer is to join Microsoft’s TechNet or for business users to look into something like MSDN. The licencing for OSX on virtual machines is tough. The shrink wrap licencing agreement for the desktop versions of OSX say that you can’t run the OS on non-Apple hardware. From what I understand, OSX VMs even on Apple hardware are a no-go too. On the other hand, you can run OSX Server in a VM on Apple hardware. I am just starting to do a little development for iOS and to get your apps into the Apple store you need physical Apple hardware. My solution so far is to use a Mac Mini for dedicated mobile development. Not ideal, but it does at least work for me.
So that’s how I handle my development hardware. On the server side TCG uses a number of VMs for various tasks. Some are kept on an internal server farm and some are hosted with other providers depending on the particular needs of that system. I’m sure most developers have at least dabbled in virtualization. If you haven’t done it, give it a try.