How to make Windows less suck for developers

Published:

As part of my objective to up my skills, I decided to check out all the hypes with Ruby on Rails. But... I'm running Windows and if you're not writing anything other than .Net languages, running Windows seems fine. For other thing it sucks a bit except for Node.js and PHP (as far as my testing goes). I've tried installing OS X Mountain Lion on VM Ware but I don't like running a full GUI to do dev work if necessary, so I installed Ubuntu 13.04 in Hyper-V so I can run it headless.

Problems

My goto language has always been C# and together with Visual Studio make it as one of the best development environment ever for developers. If you are on Linux/Mac OSX I suggest trying C#/Visual Studio and your dev world will never be the same again. However! This seems untrue for any other language like Ruby, Python, etc. Of course I can make it to work in Windows but there seems to be a lot of gotchas and hacks. But I can't leave Windows as I need to do C# development and I don't like dual booting as Ubuntu Unity is extremely ugly (I should try Ubuntu Gnome) so maybe running it headless might be a good idea.

Setups

  1. Set up Ubuntu 13.04 in Hyper-V (Why Hyper-V, not VM-Ware? Because I hate to reboot everytime I need to use VM-Ware as VM-Ware cannot play together with Hyper-V. I need to turn off Hyper-V before I can use VM-Ware but I need Hyper-V to use Windows Phone emulator)
  2. I set up two networks adapter for Ubuntu (settings in Hyper-V).
  • External network switch which connect to my router so Ubuntu can connect to Internet (You can think this as NAT to the router, basically it is on the same subnet as my PC)
  • Internal network switch so the VM can have local IP address with regard to my host (NAT setup to the host or to make it complicated, it is actually NAT inside NAT looking from the router perspective. I set the internal network switch to have IP of 192.168.2.1/24 and Ubuntu can connect to this interface and use 192.168.2.1 as my gateway. Here my PC acts as a router).
  • Well you could live with external network switch only and still communicate with your VM, but you will need an actual router. Once you go outside with no router there is no way to connect to your VM. That's where internal network switch comes in.
  • Here is an ASCII art to explain
1
2
3
4
5
6
7
8
9
10
11
    External Switch (seen as eth0 in Ubuntu)
    [The Great Internet] --> [Router/Gateway @ 192.168.1.1] --> [Windows 8 @ 192.168.1.104]
                                                            --> [Ubuntu @ 192.168.1.105]
                                                            --> [Other distro @ 192.168.1.106]

    Internal Switch (seen as eth1 in Ubuntu)
    [Windows 8/Gateway @ 192.168.2.1] --> [Ubuntu @ 192.168.2.3]
                                      --> [Other distro @ 192.168.2.4]

    Using this combination, instead of 'ssh shulhi@192.168.1.105' which will fail if I'm not connected to the router, I can just do this
    'ssh shulhi@192.168.2.3' which will work wherever I go.
  1. Then I set up SSH so I can just use putty to connect to Ubuntu.
  2. Set up a shared folder using Samba and make sure Ubuntu auto mount the shared folder everytime it starts.
  3. Now you have seamless integration between Windows and Ubuntu. I can just easily code in Sublime Text in Windows and have Rails generate all controllers, etc through SSH and all the changes are reflected on the fly as I'm using samba. In fact, this is not just limited to Rails, you can do all other things as well. Think of Ubuntu as your cloud server and having the exact copy of files locally.
  4. This is like the best of both world. Who said you have to choose only one OS :D

Other considerations

  1. I use Putty with ConEmu so command prompt sucks less.
  2. I use XMing Server for Windows just in case I need to use anything GUI from Ubuntu without the need to dive into Ubuntu.