I recently decided to see what the big deal was about OpenSim. After initially installing it on my desktop computer and connecting to it with the latest Release Candidate viewer, I decided to try to set it up on an inexpensive hosting account to see how feasible it was to run a real sim live on the Internet. Today's blog post talks a bit about how I did it, it's not a how-to guide, and you'll probably need to be a bit of a Linux geek to follow along, but hopefully you find it interesting.
The first step for hosting OpenSim was to find a suitable hosting account. Many people try to simply connect a server to their home DSL or Cable Internet service, but there are many disadvantages to this approach, mostly arising from the inexpensive equipment provided with such services often not being particularly easy to set up for inbound connections and the fact that most Telco and Cable service providers discourage the use of home Internet connections for hosting servers. Generally, if you want to host your own server, your best bet is some form of hosting provider.
There are a number of options for server hosting, including some people who are renting pre-configured OpenSim servers. Given that you can get a nice OpenSpace region (interesting to note the similarity between OpenSpace and OpenSim, intentional?) from Linden Lab for $75/month, it's my humble opinion that it defeats the purpose of setting up your own OpenSim server if you have to pay anywhere close to that much. That said, you're not going to be able to host OpenSim on a typical inexpensive shared hosting account, because it needs it's own dedicated IP addresses and ports as well as needs to have software installed that most shared hosting accounts don't provide. Luckily, there has been a recent trend to offer what's called "virtual private servers", which uses virtualization software like VMWare or Xen behind the scenes to host multiple virtual servers on a single physical server. To you and the software you install, virtualization makes it looks like you have an entire server to yourself. After some research, I found that SliceHost offers a $20/month virtual private server hosting plan which appeared to provide enough bandwidth and computing resources to comfortablely host an OpenSim simulator. Following the excellent instructions on the SliceHost website, I was able to start with an Ubuntu Hardy Heron OS image, and install Apache, MySQL, PHP, Perl, Python, Mono, and phpMyAdmin. One key point of divergence from the SliceHost instructions was when configuring the server's firewall, it was necessary to allow access to all the ports necessary for OpenSim to operate.
I initially tried to use the same pre-built OpenSim binaries that I used on my desktop. After a few mystery crashes, I decided to use svn to get the latest version of the OpenSim code. The instructions on the OpenSim website were fairly straightforward, and I was pleased that I was able to reasonably easily compile the latest version of OpenSim.
By default, OpenSim provides very minimal physics features that don't do things like prevent you from walking through walls. The recommended physics engine is called OpenDynamicsEngine, and a pre-built binary was also included with OpenSim, but this version had problems as well, forcing me to also rebuild the OpenDynamicsEngine from source to get it to work.
OpenSim can be run in either standalone mode, as a private grid, or connected to another grid. The documentation of standalone mode versus as a grid is somewhat unclear in that standalone mode is technically a simple form of a grid in that you can have as many regions as you want in a standalone simulator. I was initially confused and thought that you needed to run a grid in order to have multiple regions, but this is in fact not the case. Typically, you'll probably only use grid mode to connect a region to an existing grid, such as OSGrid. In my case, I wanted to have my own set of regions that were part of my private sandbox grid as well as have one or two regions connected to OSGrid. This proved simple to do with a couple of caveats. First of all, when I set up the firewall, I needed to make sure that I opened enough ports for all the regions I wanted to serve. The only thing that the documentation didn't explicitly state was that I needed to create two copies of the opensim/bin directory so that I could run two instances of the simulator code, one for my private grid and the other for the regions I intended to connect to OSGrid. I'm still not sure if this is absolutely necessary, but I'm pretty sure that you have to keep these installations in separate directories because they need different configuration settings in their respective OpenSim.ini configuration files. One other detail was that it was necessary to change the setting "http_listener_port" in the OpenSim.ini file for my OSGrid simulator to be the first port number in the series of port numbers assigned to the OSGrid regions.
There were a few other things that I needed to learn through trial and error and reading between the lines of the documentation. One important tip was that OpenSim isn't yet set up to easily be run and administered in a "headless" fashion. When the OpenSim server starts up, it goes into a command-line mode where you are able to administer it by entering in commands. In order to do this without having to stay connected to your server all the time, a tool called GNU Screen can be used to allow the server to run in command-line mode while still letting you disconnect and reconnect to your server via SSH.
After completing these steps, I had 3 regions in a private grid and another region attached to OSGrid, all on a $20/month hosting account. It's hard to beat that kind of price/performance ratio, although this certainly wasn't a project for the faint of heart. If there is enough interest, I'll put up a page with the start to end steps I took.
Of course, once you do this, you'll still have to grapple with the issues of having a Ruthed avatar with bad hair and skin. Using Second Inventory and test LibSL TestClient, it's possible to move some of your SL content into OpenSim (only stuff you made yourself or you bought and paid for, of course), but that's the subject of another blog post.
Wednesday, July 30, 2008
Subscribe to:
Posts (Atom)
