Wherever you go, there you are.

Technology is Neat, or How I Learned to Love the Virtual Machine


serves into machine funnelIn my last post I talked about my current development environment, and one key aspect of this environment is the use of virtualization and virtual machines. While virtualization is not a new concept (to me or to the world), it has only recently crossed into the realm of day-to-day utility in my life, and I find the entire topic to be one of those eye-catching technological wonders that throws me back to the first time I turned on a VIC-20 or started hacking away at an Osborne. In short, it makes me smile and think, "Hey... that's really neat!".

Virtualization can mean a lot of things, but lately it's been the new, trendy way of talking about what used to be lumped in with emulation. At the technical and semantic level, they are not the same thing: in emulation, the hardware you present inside the VM is entirely abstracted and is often not the same as the physical hardware of the host (e.g. emulating a Nintendo-64 on PC hardware), whereas in virtualization the guest machine sees the architecture of the host and probably even has direct access to some of its bits and pieces. From a practical standpoint, the most common end-goal for both is the same: inside a "host" OS running on real, physical hardware, create one or more "guest virtual machines" (VMs or guests) that look just like real, physical machines to anything that runs on them. The practical upshot of all this is that one piece of physical hardware can be running multiple OS instances, not even necessarily the same OS, and they all think they are running on their own little piece of hardware without a care in the world.

Again, this is nothing new. Virtualization has existed as a practical reality since at least 1972. My first negative experience with it was VMWare, and my first positive experience with it was Xen. But only recently has it truly become a useful tool for my day-to-day tasks, for a number of different reasons.

Virtualization used to be very slow and buggy in the x86 world, which is one of the major reasons that I stayed away from it. VMWare was always such a let-down for me; what they accomplished with the hardware at hand is really pretty amazing, but for day-to-day use it was far too slow and unstable for my tastes. However, hardware support for virtualization finally entered the mainstream x86 processor market (AMD and Intel CPUs) around 2007, which has opened up a world of stable and fast virtualization options.

Another limitation had always been hardware resources, and specifically memory. I've rarely had enough RAM to comfortably run my regular OS, let alone a couple of tag-along virtual machines. It's not always been just about price, but also the 4GB RAM barrier of a 32-bit OS. But with Vista 64-bit and the current prices for RAM, I've finally been able to afford and actually use a surplus of cheap memory; far more than my OS currently needs, and more than enough to handle the requirements of several VMs simultaneously.

Lastly, there seems to be a wellspring of VM options these days. VMWare has come out with a free version, Microsoft has entered the fray, and there are a number of other choices. With all of these options, I was able to find one that met my needs: Sun's VirtualBox. It's free (hey, what can I say, I'm cheap). Setting up a VM is easy, running multiple VMs is stable, and it "just works". It supports seamless mouse and keyboard integration with the guest machine, so the window running the guest OS behaves almost identically to every other window on my desktop. It supports a network mode that gives the guest OS full visibility on my internal network through promiscuous use of my NIC (sounds kinky, I know, but it isn't). And it can share files and folders on my host OS with the guest OS through an embedded file-share device that behaves just like a network mount.

With all of these forces combined, I've suddenly started using virtualization all over the place. As I already talked about in detail, I've been using it to run a guest Linux webserver VM on my Vista host in order to serve up the web apps I'm actively developing. I also use it to run a Windows XP image in order to test with IE6.

Once I started with this setup, I found other handy uses for my little virtual machines. For instance, my day-job requires that I spend a lot of time connected to various corporate VPNs, and these have an annoying tendency to kill my regular network connectivity. Also, a lot of them don't work very well on Vista; especially not 64-bit Vista. No problem now, though; I have an XP VM dedicated just to VPNs. It has all of my VPNs configured and I can connect anywhere I need without killing my host OS network. Even better, when I go on the road, I simply copy over the VM image to my laptop and run it there, without having to worry about maintaining two sets of configurations or worrying about OS compatibility.

And perhaps the most endearing and important aspect of it all is that it's just really neat! Running a Linux webserver in a little window on my Vista PC as I edit the files it serves up in real-time on my host OS while simultaneously testing these changes using IE6 on another version of Windows running inside another little window... well, that's just fundamentally cool. And I don't even take advantage of all the other nifty things you can do with virtualization, like migrating a running virtual machine from one physical machine to another without interruption, or scaling physical resources on demand between multiple VMs. With all of this cool techno-wizardry going on, it's easy to see why I finally learned to love the virtual machine.

My Development Environment


StackOverflow logoMy answer to a recent stackoverflow question got me to thinking about the long and painful process I went through in creating a development environment that met all of my idiosyncratic needs.

The question asks people what kind of setup they use for their development environments. My environment for building web applications and other personal projects went through a lot of iterations before I finally settled on one that met all of my needs and did not irritate me in any discernible fashion. Some of the personal requirements that I slowly identified as I went through this process were:

  • I need Windows: First and foremost, I'm a PC gamer. Additionally, my day-job requires a variety of Windows applications, so I need a functional Windows desktop no matter what the underlying task. Also, many of my personal projects are built in Visual Studio.
  • I need Linux: I'm also an open-source web developer and so I need Linux for many of those projects too. I use a Linux server for production deployments and it helps to have a functional Linux development server that matches that environment as closely as possible.
  • I treat personal projects like real ones: For even the simplest of personal webpages, I like to have a development environment separate from my production environment. I even like to have a test environment too, but that's not generally as critical. While it may seem like overkill for a lot of basic tasks, it enforces good habits and has saved my bacon too many times to count.
  • I need to edit locally: While I have nothing against network mounts, and in fact use a really cool NAS device for a ton of handy things, I've always found the random network delays an annoyance when editing text files. I'm a compulsive saver and every slight delay drives me nuts.
  • I don't like messing with character encodings: DOS newlines, UNIX newlines, UTF vs. standard ANSI... I'm very picky about my character encodings. I want files deployed to my production Linux environment to have UNIX newlines with UTF-8 encodings, no exceptions.
  • I'm power-conscious: At the end of the day, I want to be able to turn off as many of my electronic devices as possible, as easily as possible.
  • I like to share: I need to be able to share up-to-the-second changes in development with my wife and co-developer, with no more hassle than looking at the changes myself.

Of course, there's no single magic bullet that resolved all of these needs at once. Many of my setups excelled in some areas while falling down in others. I had several setups that were "good enough", but the slight deficiencies constantly irritated me. In some ways these were the worst, because I always felt guilty about spending time trying to improve the setup when I should have been working on code instead. But I did, finally, settle on a setup that meets all my needs and has no apparent annoyances. Without further delay, I present it to you!

The Host OS

I tried dual-booting various versions of Windows with a Linux desktop environment for a long time -- I've toyed on and off with that kind of setup for almost a decade now. But the maintenance overhead of a dual-boot system has always been a drawback to me, as well as the complexity and potential (often realized) for boot-sector SNAFUs. I've also tried Linux as my primary desktop with virtualized Windows environments, but that's always been a problem for gaming and performance concerns.

In the end, I finally settled on Windows Vista, 64-bit. 64-bit allows me to take advantage of all 4GB of my RAM (and more soon, I hope!), and I can play all of the latest and greatest PC gaming titles without problem. Further, because it is my host OS and not just a VM, I always feel like I'm getting "all the bang for my buck" when it comes to gaming or other intensive Windows tasks, like Visual Studio compiles.

The Dev Server

Finding a good choice for my Linux development server has likewise been a long and often twisting road. I've gone from dedicated servers to using my desktop as my development environment and all the way back again, before finally settling on the option that now works for me. I run a Linux (Ubuntu) server as a virtual machine (VM) on my desktop host, using Sun's VirtualBox.

Running a local VM for my development server has solved a lot of problems for me. I can edit files locally on Windows but have the guest OS serve them up without any hassle. The VM instance has its own IP, so other computers on my network can access it just like a physical host. It's easy to start and stop at will, and shuts down when I turn off my desktop at night. It also lets me experiment very easily; I can create a new server image (or clone my existing one) at any time to try out something risky or dramatic, with far less pain and suffering than in the past. It also lets me take advantage of my desktop hardware for something other than just gaming, which makes the cost of my inevitable and continuous desktop upgrades a little easier to justify. This allows me to concentrate my precious hardware funds into one machine.

The Editor

I can't even count the number of editors I've tried over the years. The one I had been using most recently was jEdit. It was powerful, had lots of optional plug-ins, and was cross-platform, which tended to come up a lot as I switched my environment around ad nauseam. But it never handled character encodings in a way that I liked, and it was always a little slow and a little clunky due to its Java implementation. I've always had problems with the damn installer too, which is a trite thing to get hung up on I suppose, but there it is.

Lately I've been using Notepad++ which is fast, lightweight, and handles character encodings exactly the way I want. I can force the default encoding to UNIX newlines and UTF-8 for all new files, and never worry about it again. It clearly indicates which encoding a file is using in case I need to convert something, and has no problem displaying any of the standard encodings I regularly come across. It has excellent syntax highlighting, but it doesn't have a lot of plug-in options, which has actually been a good thing for me. I'm no longer tempted to try all these stupid editor features which seem cool at first but ultimately become a waste of time and don't really address the problem I'm trying to solve.

So, there you have it. My ideal development environment, finally realized after almost a decade of experimentation. So... maybe now I should get on with the task of actually writing some code, eh?

What do you do with a drunken... website?


I run the Fashion Mash website, together with mezamashii, and lately I have been spending a lot of time thinking about where to go from here.

The reality is that we made a lot of mistakes during the development of Fashion Mash. We started down a promising path with a utility concept, but wandered astray into a fashion-based world that we had very strictly meant to avoid. Even the name was, in retrospect, a poor and misleading choice. This was never meant to be a fashion site but a wardrobe utility.

As a result of our many misjudgements, the site became something of an unwanted child, a poor lost project with differing taste and opinions from its parent creators. It has been neglected and left to fend for its own for many months as our attentions turned to projects more exciting or practical.

The thing is, though, that in spite of our downright abusive neglect towards this poor little website, it has still managed to keep puttering. We routinely get new signups and there is active, though somewhat anemic, community participation. There are frankly so many things wrong with the website in its current state that I'm amazed it still manages to pick up several users a week.

All of which leaves me in a bit of a quandary. The site itself still has quite a lot of untapped potential. It may never be the next Facebook, but it is certainly a concept that people seem to find attractive and, at the moment, there's only a smattering of competition. I'm certain that with a major overhaul based on all that we've learned so far, the turnover and community participation rates could be greatly improved. Of course, that would be a lot of work, and without the interest to drive that effort it becomes a mere drudgery.

And that, I suppose, is the real problem. We've fallen out of love with the site itself, and our obligations to it feel like exactly that; a sense of forlorn duty rather than one of excited passion.

As I often do in these cases, I turned to the Lucky Honu Oracle in hope of inspiration. While I have no belief in its mystical capacity, I find the presentation of a presumptuously authoritative answer to be an excellent jump start to the introspective process. My gut reactions to its prophecies frequently tell me a lot about my true feelings on the matter.

I asked the I Ching Oracle: What should we do with Fashion Mash? Fix it up or let it lie?
37. Chia Jen - Family Put the family or group first. Take the mother figure into account when making decisions.
What does the Oracle hold for you? http://luckyhonu.com/

Unfortunately, this hasn't yet opened up any new wellspring of insight into my problem. Devote energy into fixing the site and hope the spark rekindles, or let it lie dormant and let bygones be bygones?

I wonder what the legal precedent is for divorcing a website.