My Development Setup
At Mindvalley, employees can have any kind of hardware/software they want, provided that they can prove it is necessary for the work they’re doing or that it increases their productivity. In my case, I opted for the setup shown here (picture courtesy of my colleague):
(The blank monitor on the left was an Ubuntu VM in screensaver mode.)
A Brief History of My Development Machines
Before I describe the whole setup, allow me to provide a bit of background. Vishen—Mindvalley’s CEO—has decreed that every employee be issued a Mac, be it a MacBook, MacBook Pro, MacBook Air, or Mac Pro (yes, we have four of those). Only in special cases does the company get anything other than a Mac. Not only are employees to be A-players, they have to be cool and look cool as well. :)
Before this setup, I used a MacBook Air 2010 for development (and before that, a MacBook Pro 2010). The only person in the company who uses something other than a Mac is Calvin (he runs Linux on a Dell XPS laptop). All’s well and good, but when Mindvalley experienced a renaissance and shifted from being an internet marketing company to an internet services company, Calvin and I realized that our current workhorses were insufficient for the kind of work we would be doing.
And so we went about trying to get a quote for some hardware. I preferred the Mac type of environment (I loved my MacBook Air), so I thought maybe I’d get the newer MacBook Pro 2011. Calvin, of course, isn’t restricted to Apple hardware since he prefers to develop on Linux anyway. That was well and good, but when it was time to send the requisition email, I noticed that my machine was waaaay pricier than his, and I had lower specs. It was then that I had an idea.
“What if,” I thought to myself, “I can convince Vishen to get me a fast non-Apple desktop computer to save on price, then install Macintosh on it to somewhat retain the standard?” Long story short, I got my Hackintosh (my very first, and it was quite an adventure making it). I have a sweet machine, and I don’t have to unlearn and relearn my way through the OS.
The Pivot
Fast-forward to a lazy Friday afternoon when Apple Software Update prompted me to install a few updates. I’d been working with Macs for so long that installing updates without thinking about it had become second nature. Needless to say, during my next reboot, my Mac sputtered during the boot sequence.
Before all this, when I first started my foray into the forbidden world of Hackintoshes, I thought it would be such a waste if I couldn’t play any of the nice games on my machine. So I installed Windows 7 as a dual-boot option (we had a few unused licenses lying around). It was fortunate that I had this setup, because when Mac OS refused to boot, I was still able to do basic stuff (like email, Skype, and some cloud-related tasks—thank you, Google Docs!) with the Windows portion.
One lucky side effect of being in Windows was that I could use both the discrete graphics card and the onboard graphics processor at the same time, giving me the ability to use four monitors concurrently. I wasn’t able to do that with the Hackintosh; I was limited to two screens (three if I used a DVI-USB adapter, but the screen refresh rate on that monitor was too low for comfort). I realized that I might enjoy this nice side effect if I could get a decent development environment set up.
Making it Work
Everyone knows that Windows isn’t the best environment for web development. There are lots of things that I missed about the Unix-like environment on the Mac—a sane terminal and shell, development headers, web servers, and generally a dev environment close to the one in production.
What would be the best way to have such an environment? Make one in a virtual machine of course.
I installed Ubuntu 10.04 in VirtualBox (we use 10.04 in production as well, so that’s perfect: when I deploy, I know I can use the same packages). In order to access the VM, I also installed Cygwin (but I mostly just use the SSH it provides). That solves the shell issue—I have Bash inside screen and get the benefits of multiplexing and tab completion—but I’m still stuck with the horrible terminal. So I also got Xming and ran gnome-terminal off the X server. Bit by bit, I’m getting the benefits of a Unix environment—almost there.
My editor of choice is NetBeans (I’ll explain why in a future post), and I’d prefer to run it inside Windows. Running NetBeans inside Ubuntu isn’t that pretty and is pretty clunky for copy-and-paste. I thought I’d be able to use VirtualBox’s shared folder capabilities, but when I tried that, I realized that the Windows filesystem doesn’t respect file permissions—all files become 777. In order to preserve file permissions while still being able to run my editor natively (outside the VM), I used ExpanDrive to mount my VM’s filesystem through SSH. It’s $40 well spent—I tried using some free SSH filesystem software like Dokan, but wasn’t able to make it work.
To wrap things up, I used port forwarding to expose ports 3000 and 80 from the guest to the host. That way, I can run the servers from Ubuntu while still being able to access them from a native browser. Take note that WEBrick is slow when run this way—you’d need to disable reverse lookups as shown in this gist to speed it up, or just use Thin.
Summary
I think the setup is pretty sweet, and I have no complaints so far (aside from having to relearn my shortcut keys). I have a Windows machine that I don’t have to reboot for gaming, and I’m able to have a development environment very close to what we have on our production machines.
The ability to use four monitors was also very productive. I have NetBeans running on the leftmost monitor, the middle-left monitor is for my terminal (with shells being multiplexed by screen), the middle-right monitor is for the current site preview, and the far-right monitor is for viewing documentation. I think four screens is just right—any more and I’d be confused about where to look (maybe one more small monitor for an extra console output?).
One additional advantage of this setup is that the whole thing is in files. That means when I upgrade my machine in the future, I don’t have to redo my environment—it’s in a VM, so I just transplant the required files, and that’s it. What I’m planning to do next is get extra space in Dropbox or Insync and put the VM image on it. I should be able to access everything from my different workstations as long as I keep to the discipline of suspending or shutting down the VM whenever I leave.
What do you think of this setup? Any suggestions on how to improve it? Would love to hear how you would solve this if you called the shots. :)