Using Virtual Machines for Software Development

Virtual machines give development teams a consistent, recoverable environment that eliminates "works on my machine" problems and dramatically reduces new-hire onboarding time. This post weighs the concrete advantages of VM-based development—shared baselines, easy rollback, parallel environments—against performance and network trade-offs.

Coveros Staff

October 17, 2014

On my current project I am using a virtual machine (VM) that was provided by the architecture team for software development.  While I have found using this VM to be extremely useful, some developers on the project continue to build and deploy the application directly on their host machines, perhaps out of habit or an unwillingness to change something that works.  In this post I will list some of the advantages and disadvantages of using a VM for software development.

Advantages:

  • New team members start the project with a development environment that is known to work correctly.  They do not need to spend time installing and configuring software.
  • If the developer makes some change that causes the development environment to become inoperable, he or she can either use a new copy of the VM image or restore the VM to a known good state.
  • Using a VM reduces the number of occurrences of “works on my machine” syndrome.  It doesn’t eliminate this problem because developers are free to modify the VM image after they receive a copy.
  • It is possible to run multiple isolated copies of the development environment on one machine.  This is useful when a developer needs (or would like to) switch between two versions of the code base without re-building and re-deploying the application.
  • Developers are more likely to receive assistance if they have environment-related problems, such as server configuration issues.

Disadvantages:

  • There is a performance hit due to the virtualization.  This may not be as much of an issue for small projects.
  • Requests to remote servers may sometimes time out or not work correctly due to the VM network settings.
  • The developer needs to remember to “click out of” the VM before using keyboard shortcuts in the host machine.  One common example of this is attempting to Alt-Tab to a different window in the host while focus is still in the VM.

At least for me, the advantages of using a virtual machine clearly outweigh the disadvantages; however, I’m sure that this is not the case for every project.  Can you think of any situations where it clearly makes more sense to develop directly in the host machine?  Please let me know in the comments.

Coveros Staff

Coveros Staff

This post represents the collective insights of the Coveros team. Our staff consists of software experts who bring deep experience in secure agile development, DevOps, testing, and software quality. Over the past 20 years, Coveros has trained more than 30,000 professionals and worked with half of the Fortune 100 companies on mission-critical software development challenges. We draw on this extensive experience to share practical insights, proven strategies, and real-world solutions that help organizations build better software faster and more securely.