views:

556

answers:

16

What are the key use cases for the use of virtualization -- that is, running one or more "virtual PCs" using software such as VMWare and Microsoft Virtual PC -- for software development?

Also -- are there other instances/uses of virtualization that aren't covered by my definition above (use of a tool like MS Virtual PC or VMWare), and that are useful to developers?

My impetus for asking is this StackOverflow comment by Metro Smurf asserting "You'll wonder how you ever developed without it!", regarding use of virtualization.

(Please include just one use case per response. Thanks!)

+11  A: 

Application testing in multiple environments is one obvious use of virtualization that I'm aware of. Testing your application on other operating systems (without requiring additional physical computers to do so), as well as testing that involves software that generally only allows you to install a single version on a given machine (such as the Internet Explorer browser; running both IE6 and IE7 on the same machine is not an officially supported configuration), are good candidates for virtual machine usage.

Jon Schneider
I use a VM for testing an msi I built. It's great to be able to revert back to a previous snapshot and know all the changes my installer made have been undone.
Slapout
A: 

Some server applications can use VMs too. When one vm is not used much, the server can locate the resources to other vms.

Ikke
+2  A: 

The simplest case which applies to my current situation is that we have a complex client-server environment and with virtualization every developer can very quickly get a baseline set of operating systems to deploy their local build to and verify end to end functionality.

Locally you have your dev box, and N client boxes which get re-initialized as fresh OSes each time you want to try a build. Essentially it's the test environment equivalent of a 'make clean' where even the client workstation gets replaced with a new OS.

caskey
+4  A: 

If you set up snapshots of your development environment (and back them up) it can be very easy to resume productivity if your computer breaks down. When your machine breaks down right before your release - and you can resume immediately with all your tools installed and configured, it can be a lifesaver.

Tom Ritter
@AviewAnew - That does sound useful! Can you recommend any tools that can be used to set up the kind of snapshot that you are describing?
Jon Schneider
Snapshots are great to have. Even if you had a pile of physical machines under your desk for testing you would still need to backup and restore them to get them back to their original states for testing. Using VMs is much faster.
Bratch
+2  A: 

Quickly distributing environments between team members is a very nice use case to for virtualization especially if you have a lot of various components, tools, etc.. This can save you a ton of time with new hires, contractors, or other individuals who need an environment quickly.

SaaS Developer
@SaaS Developer - That does sound useful. In this case, is the distributed environment a virtual machine image (and then you actually do your development work inside the VM); or is there some other means to set up a distributed environment as you're describing?
Jon Schneider
Yes, you are correct. Once you setup your dev environment within the VM the way you want it, you create a snapshot/baseline image. You would continue to use source control to manage your source code. If or your env. crashes or a new hire comes on just use the base image and checkout latest source.
SaaS Developer
+2  A: 

Many presenters use a VM for presentations - it allows them to revert immediately to reset the presentation for the next day, transfer all presentation materials quickly between computers, and not have to show your attendees your messy My Documents folder.

Tom Ritter
@AviewAnew - Great answer. I had read about presenters using virtualization for their presentations before (e.g. Scott Hanselman on his blog), but had forgotten about it. Thanks for the reminder. :-)
Jon Schneider
+2  A: 

Using virtualization for sales activities is also a great use case. You can take a snapshot at a particular time that you can save as your demo baseline. Then once you run through the demonstration and change the data, etc. you can restore back to your previous baseline for future demonstrations. You can also capture multiple baselines and pick and choose which baseline best fits the upcoming demo.

SaaS Developer
+1  A: 

Test environments. If you have more than one setup that a system needs to be targeted for (e.g. Windows & Linux, XP & Vista) then a machine with lots of RAM and VMWare (or on of the others) is a good way to manage the environments.

Another is developing on one system and targeting another. For example, at one point I did some J2EE work on a workstation running Linux where the client was I.E. 5.5. A VM with Windows 2000 and IE 5.5 would let me test the application.

ConcernedOfTunbridgeWells
+1  A: 

Reasons I use virtual machines for development.

  • Isolate different development environments.
  • Testing environments.
  • Easy recovery due to computer hardware failure/upgrade.
  • Ability to "roll-back" changes to your development environment if something corrupts it.

Currently, I am using VirtualBox for my VM setup. I used to use VirtualPC, but I REALLY hated not having any type of "snapshot" feature (like VMware and VirtualBox have).

Nathen Silver
+4  A: 

If your build-server is running in a VM, you can make a snapshots of it for every software release in order to be 100% sure that you can recreate the build environment (in case you want to make patches to old releases, for example).

JesperE
+1  A: 

We develop software for use in our SaaS application, our production environment has a large number of servers and their software environment needs to be absolutely predictable; we can't have ANYTHING installed extra, or absent from our development machines.

Moreover, our application requires a number of different server types in order to function properly (at least 7 last time I counted); mostly they can't be installed on the same (virtual) machine - at least, not without violating the "same software as production" requirement.

In order to have a consistent environment, it's necessary to use VMs. I don't know how anyone ever manages without them.

Snapshots and rollbacks are nice too, but I use them only occasionally (really useful during installation / upgrade tests).

Suppose you're developing a new version of your software, and checking that the upgrade from the previous version works correctly... how long does it take to do a test cycle without being able to rollback the box? Do you have to reinstall the OS then the old version? Can you guarantee that the uninstall really uninstalls everything?

MarkR
+1  A: 

I've posted about this at:

http://blog.vmlogix.com/2009/01/06/the-uses-of-virtualization-in-software-engineering/

+1  A: 

Being able to test/retest your deployment process is a huge savings.

Chris Nava
+1  A: 

I'm suprised that nobody has mentioned the VMware record/replay feature (awesome video demo over at http://is.gd/eJOe ) which is great for debugging.

I have a headless server running ESXi which runs various machines for building installers (so I don't have to give up processing power on my desktop), automated testing (server is faster than any desktop) and various test environments (about 20 different configurations) so that the support team can easily jump onto a configuration that closely matches a customers system.

When you have one really beefy server running VMs that can be shared between support, test and dev teams, you introduce huge cost savings. In all, we're running ~25 VMs on ESXi (dual-quad core Xeon 2.5G + 8Gb RAM) shared between 5-10 people, some of the developers use Virtual PC and then I use VMware Workstation on my desktop. All of the Mac users here use VMware Fusion as well

sascha
+1  A: 
  • Developing Add-Ins for different versions of Microsoft Office (using Visual Studio Tools for Office).

My main work machine has Office 2007. When I work with Add-Ins for Office 2003 I use a virtual machine with Visual Studio and Office 2003.

Ole Lynge
A: 

Some sort of test environment: if you are debugging malware (either writing or developing a pill against it) it is not clever to use the real OS. The only possible disadvantage is that the viruses can detect that they are being run in the virtualization. :( One of the possibilities to do it is because the VM engines can emulate a finite set of hardware.

StarWind Software