views:

78

answers:

1

I've been thinking about virtualizing part or all of my RoR development environment.

This could have, in theory, many advantages due to encapsulation

  • easily manage app-specific configurations
  • sandboxing gems and plugins dependencies
  • cross-platform
  • plug 'n play
  • virtualization commodities, like snapshots and so on
  • separation of concerns through several appliances for the different development phases (development, testing, staging etc)

However, in practice, my first tryout really borked my workflow. My ubuntu box was running a headless VM ubuntu server, which I sshed into pretty much like you'd work off the cloud, but had local access to the source files, and edit in gVim from the host (obviously).

My problems were mainly due to editing the source from the host, and trying to rely on the guest for all things ruby, which rails.vim didn't like for example. Even though I've been hinted at some possible workarounds for this particular vim issue, it still is pretty cumbersome as it is.

An alternative would be to run a full blown guest os, and edit the source from in there, but that doesn't really appeal to me somehow.

I haven't even tried to throw cvs into the mix yet, but i can foresee that as being yet another source of headaches, that would make this setup unwieldy and pretty much defeat the purpose.

So I've yet to find a workable solution.

Have you tried to virtualize part or all of your development environment and managed not to impair your workflow, productivity or environment's friendliness, or better yet, improved it ?

+1  A: 

Absolutely yes. There is no real ideal approach for everyone, however -- after much practice you will find that it will depend on what you're most comfortable with. Some of the ways we have used Virtualization:

  • Virtualized complete .NET development environment in Windows XP, including VS 2008, IIS, MS SQL Server
  • Virtualized complete PHP + RoR development environment in CentOS
  • Virtualized multiple complete Java environments in Windows XP, including Eclipse, Tomcat / Jboss, MySQL and Apache
  • Virtualized multiple complete server environments (with GUI's) in Server 2003, Server 2008, Ubuntu, CentOS, Red Hat, and openSUSE.

In your case, I would say virtualize the entire desktop, then clone it so you can run multiple instances on which you can try your different variations of gem packages, plugins, and configurations. If your host machine has enough RAM -- at least 4GB, you should be able to run at least 3 instances needing 1GB of RAM each. Rule of thumb is to always reserve 1GB for host OS.

Also, if your machine is fast enough, you should notice little to no lag when you're running in the virtual instance GUI, except possibly when running a build script or starting a server :)

By the way, our virtualization client of choice is VirtualBox.

Josh
Good write-up, I've been using VirtualBox myself too
julien