Linux VirtualBox vs Windows for Rails Dev

So yes, everyone has heard that Mac OS X and TextMate is the epitome of Rails development, and that it is so awesome that it brings tears of joy to developers eyes, &c. However, for those of us who either don’t have a Mac, or get to work on client provided hardware (often running Windows), there are a few options available.

Developing on Windows XP, with InstantRails is workable. It is easy to get everything you need and have your apps up and running quickly. However, performance is, well, quite frankly, terrible for anything you do on the command line. Mainly, this bites when running tests, doing migrations, generating files etc. Performance running Mongrel is good enough for development.

What about Cygwin? Subjectively, I found it provided similar speed to Windows Ruby/Rails.

So this brings us to virtualisation. Recently, I've been testing out VirtualBox running Ubuntu on top of Windows XP. This has had surprisingly good results. On the same machine, the virtual Ubuntu running Rails tasks has about 4 times (!!!) faster performance, even though it has less memory and system resources!

Here are some stats to give you and idea of the advantage.

Machine is a 2.4ghz quad core, 4gig of memory running Windows XP. Using VirtualBox 2.1.4 for virtualized Ubuntu Intrepid 64 bit, with 1.5gig of memory allocated. Figures are in seconds and approximate (taken with a wrist watch).

  generate scaffold db:migrate with no changes run tests for medium sized rails app
Windows XP & Instant Rails 7 7 25
VirtualBox Ubuntu on same Windows XP 1.5 1.5 6

Some of these commands / tests rely on hitting a MySQL database. However, I’m interested in overall development speed for both platforms, not in Ruby speed in particular, so I think it is fair game to include these in the results.

So if you want to do Rails Dev on Windows, I highly recommend trying a virtual machine running Linux!


Actions

Information

8 responses to “Linux VirtualBox vs Windows for Rails Dev”

21 02 2009
Luke (21:54:38) :

Or use JRuby with Eclipse/Netbeans...

23 02 2009
Spyros (16:37:01) :

thanks for the insight. If the figures stand on my setup as well, you ll'save me a heck lot of time.
@Luke I don't know about JRuby's performance, but Eclipse (with RadRails) perform very poorly in my experience. Actually after using it for quite a time, I.. eclipsed Eclipse for Notepad++ sake (with light explorer plugin)

23 02 2009
Frank Carver’s Punch Barrel / Linux VirtualBox vs Windows (22:06:52) :

[...] Linux VirtualBox vs Windows for Rails Dev - James Crisp. [...]

4 05 2009
Sasha (13:28:29) :

And on top of that, half of the Ruby Gems required for proper Rails development don't install or don't work correctly on Windows. >_

18 06 2009
kirk (00:26:04) :

I've been using JetBrains rubyMine on windows Vista. Works quite well

13 08 2009
Rails Development on Windows: Native or Virtualize| Pathfinder Software Development | Blogs (01:03:12) :

[...] that don't have to do with trying to fix something that's broken. Performance for one. As seen here, certain tasks on windows are much slower than if virtualized, even if the virtualization has [...]

5 10 2009
bryan (12:07:37) :

Thank you for the insight. I've been running ROR on a windows 7 box and used every IDE on the Market. Until recently I installed Ubuntu and wanted to know if I can still run win7 besides a dual boot and you've answered my ?. thanks for the write up. FYI I'm new to Ubuntu, tried it a few times a couple of months back, didn't get it until now. It runs fast with fewer services. I'm a .Net Dev too and hope to be moving over to ROR soon.

9 04 2011
Rails Development on Windows: Native or Virtualize | Pathfinder Software (07:54:24) :

[...] have to do with trying to fix something that’s broken. Performance for one. As seen here, certain tasks on windows are much slower than if virtualized, even if the virtualization has [...]