Developing for Open Source Languages on Windows the Better Way

When working with php, rails, python, etc, windows is sufficient, but definitely leaves something to be desired. The ports of these languages are definitely second class. With Microsoft’s backing php support with IIS is improving, but it’s not the same. And usually you are going to deploy those apps on a linux/bsd web server, so it’s nice to know if there are any nuances. A lot of developers opt for a mac if they are developing in these types of languages. But macs can be pricey, and buying a new machine to work on other platforms seems overkill.

Now I do have a mac, but have a windows 7 laptop at work, and sometimes I do work in ruby on various projects. So I have worked out a way that I think is worth sharing. At it’s core, the idea is to use a vm, but there are some other tweaks that make this method even better.

Install VirtualBox. It’s from Sun Oracle and it’s freely available.

Create a virtual machine with Ubuntu. Or your favorite flavor of linux or bsd. I used the server version of ubuntu.

Setup Networking (Optional). You can use bridge mode, but for added security I used NAT for the adapter on the virtual machine. To then access the machine locally, forward your local ssh port to the virtual machine using the following instructions.

Install Putty with Tools and XMing in Windows. Available here and here, these tools will let you do ssh with X forwarding in windows.

Setup a Connection in Putty.
connection info

Enable X-Forwaring in Connection.

Setup SSH Tunnels.
ssh tunnel

Setup a Proxy connection in Firefox

Create your user and install your language platforms in the virtual machine. For example in ubuntu, you’re looking for “sudo apt-get install ruby-1.8”.

Install your preferred editor in the virtual machineEmacs, Vim, Eclipse, Netbeans, etc.

Your environment is now setup. I’ll give an example with ruby:

  • Start the virtual machine
  • Start XMing
  • Connect with Putty
  • Start your editor (for example “emacs &”)
  • Open Firefox
  • Start your app (for example “ruby script/server”)
  • Go to http://localhost:3000 in Firefox

This virtual machine does not require a lot of software installed, and a small amount of ram (like 128mb) should be sufficient. And by backing up your virtual machine (which should be pretty small), you have backed up your entire development environment without getting the documents, media, etc that you have on the windows side.

Hopefully you find this helpful if you want to develop in environments that lend themselves to this environment.






One response to “Developing for Open Source Languages on Windows the Better Way”

  1. Donnette Mcclour Avatar

    I like the helpful information you provide in your articles. I will bookmark your weblog and check again here regularly. I am quite certain I’ll learn many new stuff right here! Good luck for the next!