There are a couple of questions already here for whether or not a VM should be used as a development environment. I don’t wish to answer that question here but I’m assuming that a VM should be used as a development environment.
My question here is on guidelines for which tools should exist in the VM and which should exist on the host.
For example, I would generally use a VM in a headless mode for development as a Virtual GUI often means a lag. This would restrict the use of a text editor to either be a command line tool such as VIM or for a GUI text editor such as sublime text to be run in the host with a shared directory.
This then leads on to code generation (scaffolding) tools such as Yeoman’s yo. What would be the benefit this inside a VM?
I’d like to know some general guidelines so that I can have a useful developer workflow.
Here is what I do:
We have a VM for every component of our software, plus one that contains a SVN server which does version control for the code. I usually export a copy of the code from SVN on to my local machine, which is Windows and has better IDEs than Vim or Emacs (I use Eclipse). By exporting it, it is no longer in version control, so it is completely external to SVN. Our process here is that we don’t commit any changes unless we are absolutely sure it works.
I develop on my local machine, then do an sftp on the changed files to the VM, which will run and test the code. Rinse, repeat until whatever I am doing is finished. Then, pull the repository from SVN into my Eclipse using Subclipse, make the changes that I know for sure are working, then commit.
Finally, have a VM that you use to do system testing, to make sure your changes work.
To answer your question: All tooling should live inside the VM. All you do on your local box is write code. At least, that’s that I do.
Surprisingly, this is very similar to having a non-VM environment where each server hosts a big component of the software. The tradeoff of the VM “lag” is that you save a lot of rack space. I once redesigned a development lab and cut 5 full server racks into one half rack just by using VM. It saved a ton of cash.
2