Zeroconf with Littleconf (Thanks, Avahi!)

Zeroconf is made for appliances.

Think about it. The first thing you want to do when you power on an appliance — whether hardware, software, or virtual — is to configure it. Zero Configuration Networking, more commonly known as Zeroconf (and popularized by Apple’s implementation known as Bonjour), can be used to advertise network services that the box provides, such as a configuration interface.

At rPath, we have a service called the rPath Appliance Agent, which provides a framework for appliance creators to provide their users an easy way to configure and maintain their appliance without logging in via ssh. This is a very good thing.

But one thing is missing. Whenever a user boots up an appliance for the first time, he may not know what IP address the appliance will be given (if on a DHCP network). If there is no DHCP server, then there is no way to know what address — if any — that the box will be assigned. Thus, the user has to have console access to log in and figure the networking portion of the appliance. This is, as they say, suboptimal.

Enter Zeroconf. Wouldn’t it be nice if the rPath Appliance Agent on your appliance advertised that it was running on port 8004 on a particular IP address? Well, if your appliance has the excellent Zeroconf implementation known as Avahi installed, then it’s as simple as dropping a little XML descriptor file into /etc/avahi/services and voilà! Instant Zeroconf.

I tried this on my Foresight Linux install (which is not an appliance, but it does ship with Avahi). Foresight runs the rPath Appliance Agent as the base for its Foresight System Manager. To advertise port HTTP via TCP on port 8004, I created a file called raa.service and dropped it into /etc/avahi/services. I had to restart the avahi-daemon service, but after I did that, I was able to locate the instance of the rPath Appliance Agent via a popular Zeroconf-enabled browser running on another computer sharing the same network.

As cool as this is, there are a few gotchas.

  1. Zeroconf isn’t everywhere. Sure, Safari and Epiphany support it right out of the box. But to use it with Internet Explorer on Windows, you need to download the Bonjour for Windows package. That’s a headache unless you are planning on installing lots of appliances (but not too many).
  2. Avahi is not in rPath Linux 1, and the current packages for Foresight seem to compile X support in by default. However, it does look like there are packages in the devel branch, so perhaps it will appear in rPath Linux 2. In any case, there needs to be a stripped down flavor of Avahi that doesn’t need X as a dependency for appliances which don’t run X at all (which is most of them, I’d wager).
  3. To really work with Windows right out of the box, you’d probably want your appliance to also support UPNP. That’s the sad thing about standards: there are so many.

Here’s hoping this will be useful for appliance creators in the future. Less configuration is always better than more.

2007.02.01 · permalink