Last Updated: July 5, 2019

Better local development with VMs

I just downloaded and installed Ubuntu Server 9.04 in a VM Image strictly for the purposes of setting up a simple local dev environment on my MacBook. This is the base image, which I want to configure with some useful but general capabilities. The features are:

  1. LAMP stack, SSH server, svn, git, python, ruby, capistrano, etc
  2. my user account and keys set up for easy ssh access and sudo provileges
  3. netatalk and avahi-daemon

The first two points are pretty standard; the Ubuntu Server install allows you to add LAMP during the installation process, as well as Open SSH Server. Easy, right?

So what’s up with the 3rd point? As I am using OS X and VMWare Fusion, I can take advantage of the Mac platform to allow some ease-of use. If you’re not familiar with Bonjour and AFP, it’s quite slick. First off, the VM shows up in Finder’s left-side bar:

Using avahi and afp this way allows me to edit files in Komodo as if they are local, which has important advantages over remote file editing via sftp or similar. The main advantage is of course that I still get SVN status on my files via Komodo.

The other interesting advantage doesn’t have to do with Netatalk / AFP, but just with how DNS works over Bonjour.

The procedure I used to get this running has been documented here with an alternative version here. the upshot is that for Netatalk to work with Leopard, you need to compile it yourself with SSL support:

sudo apt-get install dpkg-dev
sudo apt-get install devscripts
sudo apt-get install libssl-dev
apt-get source netatalk
sudo apt-get build-dep netatalk
sudo apt-get install cracklib2-dev
cd netatalk-2.0.3
sudo dpkg -i ../netatalk_2.0.3-3ubuntu1_i386.deb

You’ll also wnat to set the custom Netatalk package to ‘hold’:

echo "netatalk hold" | sudo dpkg --set-selections

The nice thing abou this image now is that I can tuck away a copy of it for any future project and know that, with a few configuration changes, I can get a project running on the VM and be happily coding away toute suite.

Next steps? I’m going to finally start doing a few things I’ve wanted to get around to for a while, in particular managing my shell environment customizations / aliases / scripts in svn, and easily deploying applications to the vm using Capistrano scripts.

Title image courtesy of Glenn Carstens-Peters on Unsplash.