3

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.

1 Answer 1

2

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
  • I'm considering the IDE as a tool to write code. When you say all tooling should live inside the VM, what sort of tooling are you referring to?
    – Mr Wilde
    Jan 9, 2015 at 20:19
  • +1 for "All tooling should live inside the VM. All you do on your local box is write code." Please don't leave build tools outside the VM. Also if you're using some tool to manage a "project" file of some sort, you probably don't want that part straddling both environments or then it will be harder for others on your team to avoid having both VM and non-VM tooling if they don't like it. I think if someone on your team can't choose to develop purely in the VM (even if you don't like the UI experience), something might be a little bit off.
    – J Trana
    Jan 10, 2015 at 4:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.