Installing Python on FreeBSD through Parallels

April 4, 2009
by David Mytton

Last week we pushed out a new version of our server monitoring application, Server Density, which also included a new version of sd-agent. For that release we more than doubled the number of platforms we test the Python agent code on to ensure full compatibility. However, one of the questions we ask during the feedback phone calls we do with testers is what platform they are using the agent on (so we can make sure we test on it) and there will inevitably be systems we don’t cover.

One such instance arose at the end of the week with a customer having problems using the agent on FreeBSD 6.2. I have never used FreeBSD before so getting it up and running in a virtual machine to test on (we do all our development on Macs and all our testing in “the cloud” where possible, but Amazon EC2 and Mosso Cloud Servers don’t offer FreeBSD) and came across a few issues that I thought I would write about in this weekend’s technical article.

The first step was to download the FreeBSD 6.2 ISOs. This is quite an old release (current latest stable is 7.2 which I also downloaded to test on) and I eventually found them on a French mirror site.

I attempted to use the free Virtual Box from Sun but came across some disk issues so used an old copy of Parallels I already had installed. Installation was more complex than I expected (compared to Linux, for example) but the prompts are quite self explanatory so long as you read them.

The first time around I installed the minimal system but that has literally nothing and since I knew I was going to use Ports to install Python, I reinstalled with that available by default. I was surprised as how quickly the installation went – it only took 5 minutes to complete!

The first problem I came up against was no internet connectivity. This resulted in errors such as:

No address found

The solution is explained in the FreeBSD manual:

The most basic networking setup involves simply using DHCP to connect your virtual machine to the same local area network as your host Mac. This can be accomplished by adding ifconfig_ed0=”DHCP” to /etc/rc.conf.

This fixed the problem completely. I also recommend the other CPU use limiting setting also described in that section of the manual.

The final step was to use Ports to install Python. This is pretty easy too, although you do need to be root:

cd /usr/ports/lang/python25
make install clean
cd /usr/bin
ln -s /usr/local/bin/python2.5 python

And then you can get the python command prompt.

Unfortunately after all that, it turns out that FreeBSD has some differences in how commands like top output their data and as such, we can’t currently support it. This is ironic since the agent is released under the open source FreeBSD license! If you are on FreeBSD and want to register your vote for FreeBSD support, please get in touch.

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS