Friday, September 4, 2009

The headaches of running an OpenSim on a VPS

I've decided to try and set up a single OpenSim on a VPS solution. After looking at several options, I went for a VPS on Linode.com(the "Linode 540" plan, to be specific). At $30/month it's not bad at all, and the dashboard makes booting, rebooting and shutdown as simple as one mouse click. And I discovered just how ungodly easy it is to actually use ssh("I am now a true geek").

That was the good news. When I actually ssh'ed into the server and tried to follow the normal instructions to build OpenSim, I ran into a few problems. First, apt-get couldn't find any mono packages. A quick look at the sources.list file showed that the universe and multiverse repositories weren't enabled. So a quick edit and "apt-get update && apt-get upgrade && apt-get dist-upgrade" fixed that. So then I go and install all the dependencies needed for OpenSim. I download the OpenSim sources and compile it right after a bit of trial-and-error. I set up the sim accordingly(being careful to input the server's external IP address when prompted by OpenSim), and it runs fine. I fire up Meerkat and add my sim's info to the grid manager. I hit login and then on the OpenSim console...

Got a bad hardware address length for an AF_PACKET 16 8
Got a bad hardware address length for an AF_PACKET 16 8
Got a bad hardware address length for an AF_PACKET 16 8
Got a bad hardware address length for an AF_PACKET 16 8...

An endless loop of that message. I Google the error 'OpenSim "Got a bad hardware address length for an AF_PACKET 16 8"' and I find out that the error is a bug in Mono. There is a patch for it, but it requires me to compile Mono. Sigh. Well, at least all I need to compile is the base Mono tarball.

If and when I finally manage to get my sim up and running, I'll let everyone know. This experience so far has given me a greater respect for the Linden Lab "grid monkeys" and in general anyone else whose jobs require to go through this kind of torture and still manage to keep their sanity.

2 comments:

Albert Kok said...

Greetings,

You probably already solved it (or hung yourself), but heres a solution for anyone else trying to google it up. I'll try to explain it as simple as possible.

A side note: I noticed there is not much space for my example code to be properly aligned in this comment post. I'm sorry if it looks messy. Its better readable if you copy this posts content to a notepad application or such.

When you get the endless error loop you describe, you will have to recompile Mono indeed. In the source tree, edit the file NetworkInterface.cs that can be found here (seen from inside the source tree):

mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs

Find the following piece of code (in the file itself lines will have more tabs):

if (((int)sockaddrll.sll_halen) > sockaddrll.sll_addr.Length){
Console.Error.WriteLine ("Got a bad hardware address length for an AF_PACKET {0} {1}",
sockaddrll.sll_halen, sockaddrll.sll_addr.Length);
continue;
}


What has to be done here, is to add one more line before the line containing "continue;" to make it handle the next address. That new line will be:

next = addr.ifa_next;


So, afterwards the code will look like this:

if (((int)sockaddrll.sll_halen) > sockaddrll.sll_addr.Length){
Console.Error.WriteLine ("Got a bad hardware address length for an AF_PACKET {0} {1}",
sockaddrll.sll_halen, sockaddrll.sll_addr.Length);
next = addr.ifa_next;
continue;
}


Save and recompile Mono from this source tree, OpenSim will no longer get stuck in the error loop.

Regards,

Albert Kok
i at ownroot dot org

Albert Kok said...

I see the code is quite readable after all. All thats missing are the tabs.

Regards,

Albert Kok
i at ownroot dot org